3

I'm experiencing a strange issue here where the price navigation filter (layered navigation) somehow came up with negative price ranges.

negative price range

If I flush the price tables it seems to solve the problem, until next time prices get re-indexed. Then the negative price ranges re-appear.

Another issue is that the price ranges are not even accurate. It would show the following: CA$0.00 - CA$9.99 (2) - as if there are 2 items within this price range. But we do not have any items priced within this price range...

inaccurate price range

Help please!!

  • magento 1 or 2? custom layered navigation or default? etc – CompactCode Mar 18 '18 at 12:18
0

The solution documented here works for me, although I didn't test it thoroughly:

Rewrite the following file using the correct class rewrite procedure, and perform an price reindex subsequently.

File: vendor/magento/module-configurable-product/Model/ResourceModel/Product/Indexer/Price/Configurable.php

Method: _applyConfigurableOption()

Replace:

$select->columns(
    [
        'min_price' => new \Zend_Db_Expr('i.min_price - i.orig_price + io.min_price'),
        'max_price' => new \Zend_Db_Expr('i.max_price - i.orig_price + io.max_price'),
        'tier_price' => 'io.tier_price',
    ]
);

With:

$select->columns(
    [
        'min_price' => new \Zend_Db_Expr('io.min_price'),
        'max_price' => new \Zend_Db_Expr('io.max_price'),
        'tier_price' => 'io.tier_price'
    ]
);
0

For Magento 2.2.x

This is not a code but a data issue. In most cases it can appears when you use direct (used SQL queries) product import tools. I've taken one configurable product with negative min_price and max_price, imported with special prices and dropped special price for it and it's child products. After re-index I haven't seen any results, and only after saving this configurable product from admin, I saw the changes. It shows, that direct special prices import doesn't trig some important index processes. It still incorrect:

enter image description here

but it shows a bug. E.g. I took another product without any special prices for itself and its' child products, and set it special price for some option. After re-index everything looked fine:

enter image description here

So, check that products that you import don't have special price (at least configurable products), or change your import tool.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.