-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Issue: ready for confirmationReported on 2.4.8-p1Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.duplicate
Description
Preconditions and environment
Magento version: 2.4.8-p1
\Magento\Catalog\Pricing\Price\SpecialPriceBulkResolver::generateSpecialPriceMap has $storeId as input, but the table catalog_product_index_price is filtered on website_id in that method.
Steps to reproduce
- Set a special price on a product on a Website and Storeview other than the default. Storeview ID must be higher than 3 and max 2 websites, to be sure it fails.
- Navigate to a catalog page. Observe the old price not being shown.
Expected result
Old and new price should be shown.
Actual result
Only new price is shown.
Additional information
Method generateSpecialPriceMap
takes in storeId as an argument, but the method filters on website_id:
...
->joinLeft(
['price' => $this->resource->getTableName('catalog_product_index_price')],
'price.entity_id = COALESCE(link.product_id, e.entity_id) AND price.website_id = ' . $storeId .
' AND price.customer_group_id = ' . $this->customerSession->getCustomerGroupId()
)
Changing \Magento\Catalog\Block\Product\ListProduct::getPriceRender
so it uses the website id fixes the problem:
protected function getPriceRender()
{
$block = $this->getLayout()->getBlock('product.price.render.default');
$block->setData('is_product_list', true);
if ($this->specialPriceMap === null) {
$this->specialPriceMap = $this->specialPriceBulkResolver->generateSpecialPriceMap(
// (int)$this->_storeManager->getStore()->getId(),
(int)$this->_storeManager->getWebsite()->getId(),
$this->_getProductCollection()
);
}
return $block->setData('special_price_map', $this->specialPriceMap);
}
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
Issue: ready for confirmationReported on 2.4.8-p1Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.duplicate