@@ -82,11 +82,11 @@ class Tools
82
82
public function __construct (
83
83
PriceCurrencyInterface $ priceCurrency ,
84
84
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
90
90
) {
91
91
$ this ->priceCurrency = $ priceCurrency ;
92
92
$ this ->objectManager = $ objectManager ;
@@ -144,7 +144,7 @@ public function formatPrice($price, $storeId = null)
144
144
$ baseCurrency ->getCode ()
145
145
);
146
146
// workaround for 2.4.3
147
- $ price = trim ($ price , $ currencySymbol );
147
+ $ price = trim ($ price , $ currencySymbol ?? '' );
148
148
return $ price ;
149
149
} catch (Exception $ e ) {
150
150
return '' ;
@@ -204,10 +204,10 @@ public function getProductPrice(Product $product)
204
204
*/
205
205
public function getProductSalePrice (Product $ product )
206
206
{
207
- if ($ product ->getFinalPrice () > 0 && $ product ->getPrice () > $ product ->getFinalPrice ()) {
207
+ if ($ product ->getSpecialPrice () > 0 && $ product ->getPrice () > $ product ->getSpecialPrice ()) {
208
208
$ 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 ();
211
211
return $ this ->formatPrice ($ price , $ product ->getStoreId ());
212
212
}
213
213
return '' ;
0 commit comments