We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello!
In the class HistoricalPriceBox.php currencies are not respected therefore the pricebox will behave differently in stores with multiple currencies.
I would suggest to amend the class to solve this issue:
Use-Statement:
use Magento\Framework\Pricing\Helper\Data;
Class:
$_priceHelper
__construct
$historicalPrice = $this->_priceHelper->currency($product->getData('historical_price'), false, false);
class HistoricalPriceBox extends FinalPriceBox { protected $_priceHelper; /** * @param Context $context * @param SaleableInterface $saleableItem * @param PriceInterface $price * @param RendererPool $rendererPool * @param array $data * @param SalableResolverInterface $salableResolver * @param MinimalPriceCalculatorInterface $minimalPriceCalculator * @param Data $priceHelper */ public function __construct( Context $context, SaleableInterface $saleableItem, PriceInterface $price, RendererPool $rendererPool, array $data = [], SalableResolverInterface $salableResolver = null, MinimalPriceCalculatorInterface $minimalPriceCalculator = null, Data $priceHelper ) { $this->_priceHelper = $priceHelper; parent::__construct($context, $saleableItem, $price, $rendererPool, $data, $salableResolver, $minimalPriceCalculator); } public function canShowPrice(): float { $product = $this->getSaleableItem(); $historicalPrice = $this->_priceHelper->currency($product->getData('historical_price'), false, false); return (int) $product->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE)->getValue() > (int) $historicalPrice && (int) $historicalPrice > 0; } }
Best regards!
The text was updated successfully, but these errors were encountered:
Hello @stefan-teichmann,
feel free to create a pull request for this issue and I we will merge it.
Best regards Jakub Idziak
Sorry, something went wrong.
Respect currency-conversion in HistoricalPriceBox.php.
5f2fe94
Solves macopedia#4
906fa7a
Successfully merging a pull request may close this issue.
Hello!
In the class HistoricalPriceBox.php currencies are not respected therefore the pricebox will behave differently in stores with multiple currencies.
I would suggest to amend the class to solve this issue:
Use-Statement:
Class:
$_priceHelper
,__construct
-method$historicalPrice = $this->_priceHelper->currency($product->getData('historical_price'), false, false);
Best regards!
The text was updated successfully, but these errors were encountered: