inventory
inventory copied to clipboard
Bundle with dynamic price is not sorted correctly
Bundle product with the dynamic price isn't sorted correctly in the categories.
Final price, price, min and max price are 0.0000 in catalog_product_index_price table for bundle product because Magento tries to load simple products prices in \Magento\Bundle\Model\ResourceModel\Indexer\Price::calculateDynamicBundleSelectionPrice
method and it checks if product is available in the default stock:
$select->join(
['si' => $this->getTable('cataloginventory_stock_status')],
'si.product_id = bs.product_id',
[]
);
$select->where('si.stock_status = ?', Stock::STOCK_IN_STOCK);
$this->tableMaintainer->insertFromSelect($select, $this->getBundleSelectionTable(), []);
Preconditions (*)
- Magento 2.4.2
- Additional source (test_source) added
- Additional stock (test_stock) added
- test_source is assigned to test_stock and test_stock is assigned to the website
Steps to reproduce (*)
- Add at least two simple products with different price
- Add bundle product with dynamic price and add one simple product with qty e.g. 5
- Assign all products to one category
- Open this category on frontend and sort by price (desc or asc)
Expected result (*)
- Products are sorted by price correctly
Actual result (*)
- Simple products are sorted correctly but bundle product isn't
Hi @Leone. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.
Please, add a comment to assign the issue: @magento I am working on this
- Join Magento Community Engineering Slack and ask your questions in #github channel.