“As Low As” / Expired Special Price Still Showing (Magento 2.1.11)
-
16-02-2021 - |
Question
I have a configurable product with two variations. Each simple product has a special price set as expiring yesterday, and this is properly reflected when the product is added to the cart.
However, "As Low As [special price]" still displays on the product. Is this the intended behavior, or is there a way to fix this? Thanks!
Edit: have of course tried flushing cache/reindexing/etc. Also, some easy bounty for someone to collect, I'd imagine.
Solution
To fix this issue you need to edit the following file:
vendor/magento/module-configurable-product/Pricing/Price/LowestPriceOptionsProvider.php
change line 58: from:
->addAttributeToSelect(['price', 'special_price'])
to:
->addAttributeToSelect(['price', 'special_price', 'special_from_date', 'special_to_date'])
OTHER TIPS
Its a default bug of Magento2.
You can see the GIT commit in the latest version of Magento2.
Reference GIT commit :
https://github.com/magento/magento2/commit/1ab9b26828cd4da268e9a7481d4969bffb1460c1
Upgrade to the latest version of Magento2 will resolve your issue.