Skip to content

Commit 55bb0f1

Browse files
authored
Fixing Sale Price Issue (#456)
* Fixing Sale Price Issue * fixing the exception in calling trim --------- Co-authored-by: Avinash Singhal <[email protected]>
1 parent c6d3315 commit 55bb0f1

File tree

1 file changed

+9
-9
lines changed
  • app/code/Meta/Catalog/Model/Product/Feed/Builder

1 file changed

+9
-9
lines changed

app/code/Meta/Catalog/Model/Product/Feed/Builder/Tools.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ class Tools
8282
public function __construct(
8383
PriceCurrencyInterface $priceCurrency,
8484
ObjectManagerInterface $objectManager,
85-
Escaper $escaper,
86-
SystemConfig $systemConfig,
87-
CatalogHelper $catalogHelper,
88-
ModuleManager $moduleManager,
89-
StoreManagerInterface $storeManager
85+
Escaper $escaper,
86+
SystemConfig $systemConfig,
87+
CatalogHelper $catalogHelper,
88+
ModuleManager $moduleManager,
89+
StoreManagerInterface $storeManager
9090
) {
9191
$this->priceCurrency = $priceCurrency;
9292
$this->objectManager = $objectManager;
@@ -144,7 +144,7 @@ public function formatPrice($price, $storeId = null)
144144
$baseCurrency->getCode()
145145
);
146146
// workaround for 2.4.3
147-
$price = trim($price, $currencySymbol);
147+
$price = trim($price, $currencySymbol ?? '');
148148
return $price;
149149
} catch (Exception $e) {
150150
return '';
@@ -204,10 +204,10 @@ public function getProductPrice(Product $product)
204204
*/
205205
public function getProductSalePrice(Product $product)
206206
{
207-
if ($product->getFinalPrice() > 0 && $product->getPrice() > $product->getFinalPrice()) {
207+
if ($product->getSpecialPrice() > 0 && $product->getPrice() > $product->getSpecialPrice()) {
208208
$price = $this->systemConfig->isPriceInclTax()
209-
? $this->catalogHelper->getTaxPrice($product, $product->getFinalPrice(), true)
210-
: $product->getFinalPrice();
209+
? $this->catalogHelper->getTaxPrice($product, $product->getSpecialPrice(), true)
210+
: $product->getSpecialPrice();
211211
return $this->formatPrice($price, $product->getStoreId());
212212
}
213213
return '';

0 commit comments

Comments
 (0)