inventory icon indicating copy to clipboard operation
inventory copied to clipboard

Bundle with dynamic price is not sorted correctly

Open Leone opened this issue 3 years ago • 1 comments

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 (*)

  1. Magento 2.4.2
  2. Additional source (test_source) added
  3. Additional stock (test_stock) added
  4. test_source is assigned to test_stock and test_stock is assigned to the website

Steps to reproduce (*)

  1. Add at least two simple products with different price
  2. Add bundle product with dynamic price and add one simple product with qty e.g. 5
  3. Assign all products to one category
  4. Open this category on frontend and sort by price (desc or asc)

Expected result (*)

  1. Products are sorted by price correctly

Actual result (*)

  1. Simple products are sorted correctly but bundle product isn't

Leone avatar Jul 08 '21 13:07 Leone

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


m2-assistant[bot] avatar Jul 08 '21 13:07 m2-assistant[bot]