Magento2: How can I disable minimal price?

Created on 9 Jun 2016  Â·  26Comments  Â·  Source: magento/magento2

My catalog is showing "as low as" for each product that I have changed the price.

as-low-as

"Tão baixo quanto": "as low as" in portuguese :)

Tier price isn't configured for my products, so I think it is related to product's minimal price

How can I disable it?

I'm using version 2.1.0-rc1.

needs update

Most helpful comment

I can confirm I have the same issue with version 2.1.7.
I have several products showing the "as low as" and other not: there is any tier price settings for any product so there is any logic !
I have also problems on displaying special prices , which are printed as normal prices instead of discount.

All 26 comments

Hi @ycherfan , has you run reindex after updating the price?

Thanks,
Anton.

@antboiko We are having this same problem on a client website and I think I've narrowed down its cause after several hours of debugging (EE 2.0.6). We are using per-website prices with manual entry, rather than global prices or currency conversion. And I've found that, for us at least, this is the result of a bug in M2 price indexing.

To give an example to illustrate the bug, my control product for debugging this error, we have a configurable product which is £229 in default values scope, €275 in the EU website (ID=4), $395 in the US website (ID=6) etc. However, when testing the EU website we are seeing "€275, as low as €229" in this product's price block in product list.

I checked the EAV data for the configurable and all simple products - no problems there, everything seems correct. So I checked catalog_product_index_price... Red flag. An extract of this product's data from the table as CSV:

entity_id,customer_group_id,website_id,tax_class_id,price,final_price,min_price,max_price,tier_price
147,0,2,2,229,229,229,229,NULL
147,0,3,2,229,229,229,229,NULL
147,0,4,2,275,275,229,229,NULL
147,0,5,2,229,229,229,229,NULL
147,0,6,2,395,395,229,229,NULL
147,1,2,2,229,229,229,229,NULL
147,1,3,2,229,229,229,229,NULL
147,1,4,2,275,275,229,229,NULL
147,1,5,2,229,229,229,229,NULL
147,1,6,2,395,395,229,229,NULL
147,2,2,2,229,229,229,229,NULL
147,2,3,2,229,229,229,229,NULL
147,2,4,2,275,275,229,229,NULL
147,2,5,2,229,229,229,229,NULL
147,2,6,2,395,395,229,229,NULL
147,3,2,2,229,229,229,229,NULL
147,3,3,2,229,229,229,229,NULL
147,3,4,2,275,275,229,229,NULL
147,3,5,2,229,229,229,229,NULL
147,3,6,2,395,395,229,229,NULL

While price and final_price are correct for each row, min_price and max_price do not reflect the per-website prices - rather they reflect the default values. When I manually patch these values with a simple query, the price display self-corrects to the proper "€275" without showing an incorrect "as low as" price:

update catalog_product_index_price set min_price=275, max_price=275 where entity_id=147 and website_id=4;

Following this discovery I spent some time dismantling & manually testing the queries performed by the configurable price indexer to find the point of failure. My understanding from debugging and trial & error is that first up, Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice::prepareFinalPriceDataForType() prepares price data in the temporary table catalog_product_index_price_final - and correctly as far as I can tell:

entity_id,customer_group_id,website_id,tax_class_id,orig_price,price,min_price,max_price,tier_price,base_tier
147,0,2,2,229,229,229,229,NULL,NULL
147,0,3,2,229,229,229,229,NULL,NULL
147,0,4,2,275,275,275,275,NULL,NULL
147,0,5,2,229,229,229,229,NULL,NULL
147,0,6,2,395,395,395,395,NULL,NULL
147,1,2,2,229,229,229,229,NULL,NULL
147,1,3,2,229,229,229,229,NULL,NULL
147,1,4,2,275,275,275,275,NULL,NULL
147,1,5,2,229,229,229,229,NULL,NULL
147,1,6,2,395,395,395,395,NULL,NULL
147,2,2,2,229,229,229,229,NULL,NULL
147,2,3,2,229,229,229,229,NULL,NULL
147,2,4,2,275,275,275,275,NULL,NULL
147,2,5,2,229,229,229,229,NULL,NULL
147,2,6,2,395,395,395,395,NULL,NULL
147,3,2,2,229,229,229,229,NULL,NULL
147,3,3,2,229,229,229,229,NULL,NULL
147,3,4,2,275,275,275,275,NULL,NULL
147,3,5,2,229,229,229,229,NULL,NULL
147,3,6,2,395,395,395,395,NULL,NULL

These values would be based on the configurable product's own price data, which I know is hidden in admin, but is still available via models & not validated so I would assume it's non-breaking.

Where this breaks down is when, subsequently, Magento\ConfigurableProduct\Model\ResourceModel\Product\Indexer\Price\Configurable::_applyConfigurableOption() attempts to update catalog_product_index_price_final for configurable products using MIN() and MAX() to derive a range from their simple associated products. Specifically, at this line:

$priceColumn = $this->_addAttributeToSelect($select, 'price', 'l.product_id', 0, null, true);

This method is defined in Magento\Catalog\Model\ResourceModel\Product\Indexer\AbstractIndexer as:

protected function _addAttributeToSelect($select, $attrCode, $entity, $store, $condition = null, $required = false);

So now we know that the configurable price indexer will select the min/max simple prices _only_ from default values scope - zero - since it is hard-coded with 0 to do so. Meaning that any website with different pricing than default values will show incorrect minimum/maximum prices, presuming the minimum price is lower than final price and/or the maximum price is higher.

It seems to me that fixing this involves substituting the _addAttributeToSelect() call with something scope-friendly following a join store on store.website_id=i.website_id (perhaps easier said than done!)

Oh, and I've checked - this isn't fixed in any newer version than 2.0.6, so it's an open bug.

Hi @annybs @antboiko

This is indeed a bug in price indexer. It is logged as MAGETWO-53130 internally and planned for 2.2 release.

@annybs do you have a cron job setup to run every minute? The issue should be fixed after cron runs as far as I understand.
http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html

Thanks,
Kateryna.

@katmoon I created PR #5053 with a fix for this bug. We do have cron jobs enabled, but it's not a cron problem - the price collection query itself is broken, as I detailed above.

MAGETWO-53130 and MAGETWO-54320 both relate to the same problem and while they were not included in 2.1 they will be in the 2.1.1 release, so we are actually working on it but we need time for princing testing and do some performance tests also

What basically happens is that the product collection loads the price from EAV rather from the index, creating a discrepancy between price and min-max,
That's combined with the issue that when index is run it updates those prices, dispatches an event to clear full page cache, but it never clears out the blocks

So watch out for the out-coming patches in the next releases as we are aware of this problem

@cpartica @katmoon Can this issue I posted be related to this issue? https://github.com/magento/magento2/issues/5364

This issue is related to #5364
This issue has been resolved and merged to develop (via MAGETWO-54320) and it will available in the next release. Feel free to let us know if you encounter any other issues.

The issue has been fixed in 2.1.1

@elenleonova Any idea on when 2.1.1 will be released?

Nevermind I see it's released now, thank you!!

Nevermind I see it's released now, thank you!!

Not fixed in 2.1.1, at least for enterprise. Ticket to support created.

I'm still having this problem with 2.1.1 CE

I just upgraded to 2.1.2 and the problem persists.

I can confirm this problem persists in 2.1.3CE, however it only seems to happen to configurable products for us. It is showing the min price as the default view price (US) * exchange rate on our Canadian store.

This can be fixed by modifying code at location \vendor\magento\module-catalog\view\base\templates\productpricefinal_price.phtml on line no. 52
Disable the following block

showMinimalPrice()): ?>
getUseLinkForAsLowAs()):?>

@escapeNotVerified */ echo $block->renderAmountMinimal(); ?>



@escapeNotVerified */ echo $block->renderAmountMinimal(); ?>



This may resolve the issue..

@bcdhamecha , This removes it on the product view page, what about on the category product list/grid view ?

The only way I could find to remove the "As Low As" text was in the following file:
\vendor\magento\module-catalog\Pricing\Render\FinalPriceBox.php
and comment out (line 111 - 122):

    public function renderAmountMinimal()
    {
        /** @var \Magento\Catalog\Pricing\Price\FinalPrice $price* / <~~~~Add space
        $price = $this->getPriceType(\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE);
        $id = $this->getPriceId() ? $this->getPriceId() : 'product-minimal-price-' . $this->getSaleableItem()->getId();
        return $this->renderAmount(
            $price->getMinimalPrice(),
            [
                'display_label'     => __('As low as'),
                'price_id'          => $id,
                'include_container' => false,
                'skip_adjustments' => true
            ]
        );   */  <~~~~ Insert close comment
    }

@elenleonova this is still not fixed in 2.1.6 EE

Looking forward to 2.2 version...

@spyrule I'm able to make your suggestion work but should I be concerned that the change will be impacted if I update my magento version? If so, how would I edit this file or create a 'child version' to avoid that?

@MaxC808 You can always create a base "patch" module, and then re-create this file within that patch, and comment out the affected code (which is really the proper way to apply a temp fix). My "fix" is ONLY suggested as a short-term patch until this issue is fixed properly.

If you upgrade, my fix will get undone, and the problem will return.

I can confirm this is not fixed in 2.1.7! Any workaround here as configurable product prices are not a minor issue. At our case the special price is not shown right at configurable products at all.

It is one year later now since this was reported and this is not included in a public version so far... wow!

I can confirm I have the same issue with version 2.1.7.
I have several products showing the "as low as" and other not: there is any tier price settings for any product so there is any logic !
I have also problems on displaying special prices , which are printed as normal prices instead of discount.

I'm having this issue immediately after having upgraded from 2.2.3 to 2.2.5 (Open Source) - no tiered prices in place - showing on both the product page and category view page. Very frustrating.

Was this page helpful?
0 / 5 - 0 ratings