Are min_price and max_price in catalog_product_index_price accurate for products with tiered pricing?
-
13-12-2019 - |
Question
It seems like min_price
and max_price
aren't generally accurate in catalog_product_index_price
for simple products using tiered pricing.
I haven't yet drilled into Mage_Catalog_Model_Resource_Product_Indexer_Price_Default
to get a better idea of what's going on under the hood, but I've taken a look at the sample data.
Here's a product using tiered pricing:
And the values in catalog_product_index_price
for it:
I would think this would be a perfect place for min_price
to reflect, well, the minimum possible price for the product. It does seem that the tier_price
column perhaps contains that value though.
Solution
If you take a look at SELECT of Magento Product Collection, you'll see that Magento does LEAST(min_price, tier_price, group_price) as minimal_price
.
So you minimal_price is not a value from min_price column. I think it is done, to make a lowest possible price without group or tier price discounts being available for devs to access. Especially if you consider all that backward compatibility mess.