Incorrect min price calculation for products with custom options. #7740
Labels
bug report
Component: Catalog
Component: Tax
Issue: Cannot Reproduce
Cannot reproduce the issue on the latest `2.4-develop` branch
Issue: Format is valid
Gate 1 Passed. Automatic verification of issue format passed
Progress: needs update
Preconditions
Steps to reproduce
Expected result
Actual result
I got this explanation of the issue from one of our developers:
When saving product with options, Magento saves prices of these options in the table ‘catalog_product_options_type_price’. Code for this operation can be found in \Magento\Catalog\Model\ResourceModel\Product\Option\Value method _saveValuePrices. On the line 98, it check condition “$object->getPrice() $priceType“ and saves price only if it is true. Because for a free options price is zero, it causes that prices for free options are not saved in the table.
When reindexing product prices, prices of custom options are applied in the Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice method _applyCustomOption. At the line 457 it join the table ‘catalog_product_options_type_price’ in order to get minimal values of prices. Because originally this table does not contain zero prices, they are not applied to the minimal price calculation and, thus, not-minimal value of price is used instead.
The text was updated successfully, but these errors were encountered: