organicinternet / magento-configurable-simple

Enhancement to Magento to allow simple product prices to be used instead of the default special-case configurable product prices
http://organicinternet.co.uk/
282 stars 266 forks source link

min_price wrong on catalog_product_index_price #305

Open fabrice-dresscodes opened 5 years ago

fabrice-dresscodes commented 5 years ago

Hello,

I'm not sure but why 'OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Price_Configurable'

has

        'max_price'     => new Zend_Db_Expr('MAX(inner.max_price)'),

but not

        'min_price'     => new Zend_Db_Expr('MIN(inner.min_price)'),

I had issue with minimal price on product listing but not on product view.

The table 'catalog_product_index_price"."min_price" was wrong before I added => new Zend_Db_Expr('MIN(inner.min_price)'), on line 127

Magento 1.9.3.1

mbautista commented 5 years ago

Hello, We had the same problem with Magento 1.9 with MariaDB 10.1. The subquery is not ordered like on MySql so the displayed price is not always the best.

If we modify the min_price it displays the buggy price and below "Special price = min_price" on the product list page, so instead we modified the price and the orig_price (modifying only the price displays the buggy price stricked though and then the correct price) :

...
            'orig_price'    => new Zend_Db_Expr('MIN(inner.min_price)'),
            'price'         => new Zend_Db_Expr('MIN(inner.min_price)'),
             'min_price',
             'max_price'     => new Zend_Db_Expr('MAX(inner.max_price)'),
...