Magento2: M2C 2.2.3 Configurable product - special price does not display on Category page and Product page

Created on 8 May 2018  路  16Comments  路  Source: magento/magento2


Preconditions


  1. Magento version 2.2.3.
  2. Php - 7.1.16

Steps to reproduce

  1. Add product as usual and set the special price for the product.
  2. Add variations for size by adding under size attribute (Custom created size attribute)
  3. Create the product listing.
  4. Once product is created, flush all the cache and check listing. Listing is successfully created with all the variations.
  5. Under Category page, cant see special price and original price together. It directly shows only special price. When we click on the product, it goes to the product page. Before clicking any attribute, it still shows only special price directly but does not show any original price. Once click any size attribute, can see both original size and also special price in product page only.Category page never displays original price at all.

Expected result

  1. Special price should be shown along with Original price in category page and also product page before clicking on any attributes.

Actual result

  1. Directly special price is shown everywhere on category page and also product page.

ConfigurableProduct mm19pl Clear Description Confirmed Format is valid Ready for Work Reproduced on 2.2.x Reproduced on 2.3.x

Most helpful comment

@engcom-backlog-nickolas Can you please explain, why do we have to keep using third party extensions for every basic thing, if this is the case, better leave magento as is and tell people it all depends now on third party extensions to complete everything you need in magento. Also issue relating the special pricing in configurable products is important if you have Google product feed extension as special pricing has been set in the product feed extension to display that pricing in google.

All 16 comments

Hello @devhelp37, thank you for your report.
We've acknowledged the issue and added to our backlog.

Is there any update on this @engcom-backlog-nickolas ? We are experiencing this issue on a current M2C 2.2.3 build and need it solved before launch.

Hello @PaulWMF, as configurable product price depends on price of it's children and configurable itself has no own price, it should not have it's own special price too.
So, currently there is a bug when you converting simple product with special price to configurable, Special price remains on configurable product, which leads to confusion on category page, where you see configurable special price instead of option price and on PDP, where you can see both: configurable special price and option price. Which, for instance, never happen in case you create configurable product from the beginning without conversion.
Therefore, when it will be fixed, there will be no ability to see both: special and option price on category page in vanilla magento. And it's correct behaviour.
If You want to see both prices on category page with configurable product, it would be better to implement custom solution, or try to find some 3d-party extensions which may provide such functionality.

Best regards!

@engcom-backlog-nickolas we fixed this by:

Overriding vendor/magento/module-configurable-product/view/base/templates/product/price/final_price.phtml

  1. Removed the condition to check is product isn't in a list

From:

<?php if (!$block->isProductList() && $block->hasSpecialPrice()): ?>

To:

<?php if ($block->hasSpecialPrice()): ?>
  1. Removed 'no-display' class from regular price span

From:

<span class="old-price sly-old-price no-display">
        <?php /* @escapeNotVerified */ echo $block->renderAmount($priceModel->getAmount(), [
            'display_label'     => __('Regular Price'),
            'price_id'          => $block->getPriceId('old-price-' . $idSuffix),
            'price_type'        => 'oldPrice',
            'include_container' => true,
            'skip_adjustments'  => true
        ]); ?>
    </span>

To:

<span class="old-price">
            <?php /* @escapeNotVerified */ echo $block->renderAmount($priceModel->getAmount(), [
                'display_label'     => __('Regular Price'),
                'price_id'          => $block->getPriceId('old-price-' . $idSuffix),
                'price_type'        => 'oldPrice',
                'include_container' => true,
                'skip_adjustments'  => true
            ]); ?>
        </span>

@engcom-backlog-nickolas Can you please explain, why do we have to keep using third party extensions for every basic thing, if this is the case, better leave magento as is and tell people it all depends now on third party extensions to complete everything you need in magento. Also issue relating the special pricing in configurable products is important if you have Google product feed extension as special pricing has been set in the product feed extension to display that pricing in google.

9322 worked for me in 2.2.5

@engcom-backlog-nickolas we fixed this by:

Overriding vendor/magento/module-configurable-product/view/base/templates/product/price/final_price.phtml

  1. Removed the condition to check is product isn't in a list

From:

<?php if (!$block->isProductList() && $block->hasSpecialPrice()): ?>

To:

<?php if ($block->hasSpecialPrice()): ?>
  1. Removed 'no-display' class from regular price span

From:

<span class="old-price sly-old-price no-display">
        <?php /* @escapeNotVerified */ echo $block->renderAmount($priceModel->getAmount(), [
            'display_label'     => __('Regular Price'),
            'price_id'          => $block->getPriceId('old-price-' . $idSuffix),
            'price_type'        => 'oldPrice',
            'include_container' => true,
            'skip_adjustments'  => true
        ]); ?>
    </span>

To:

<span class="old-price">
            <?php /* @escapeNotVerified */ echo $block->renderAmount($priceModel->getAmount(), [
                'display_label'     => __('Regular Price'),
                'price_id'          => $block->getPriceId('old-price-' . $idSuffix),
                'price_type'        => 'oldPrice',
                'include_container' => true,
                'skip_adjustments'  => true
            ]); ?>
        </span>

After doing this, old and special prices are shown but on changing the attributes like size or color the price doesn't update.
How to do that?

@engcom-backlog-nickolas we fixed this by:
Overriding vendor/magento/module-configurable-product/view/base/templates/product/price/final_price.phtml

  1. Removed the condition to check is product isn't in a list

From:

<?php if (!$block->isProductList() && $block->hasSpecialPrice()): ?>

To:

<?php if ($block->hasSpecialPrice()): ?>
  1. Removed 'no-display' class from regular price span

From:

<span class="old-price sly-old-price no-display">
        <?php /* @escapeNotVerified */ echo $block->renderAmount($priceModel->getAmount(), [
            'display_label'     => __('Regular Price'),
            'price_id'          => $block->getPriceId('old-price-' . $idSuffix),
            'price_type'        => 'oldPrice',
            'include_container' => true,
            'skip_adjustments'  => true
        ]); ?>
    </span>

To:

<span class="old-price">
            <?php /* @escapeNotVerified */ echo $block->renderAmount($priceModel->getAmount(), [
                'display_label'     => __('Regular Price'),
                'price_id'          => $block->getPriceId('old-price-' . $idSuffix),
                'price_type'        => 'oldPrice',
                'include_container' => true,
                'skip_adjustments'  => true
            ]); ?>
        </span>

After doing this, old and special prices are shown but on changing the attributes like size or color the price doesn't update.
How to do that?

Did you find a solution?

Yes I had found the solution.
I had managed this by overriding the template in active theme.

app\design\frontend\\\Magento_Swatches\templates\product\listing\renderer.phtml

/**

  • Copyright 漏 Magento, Inc. All rights reserved.
  • See COPYING.txt for license details.
    */
    ?>
    @var $block \Magento\Swatches\Block\Product\Renderer\Listing\Configurable */ ?>

will this get fixed?

product with special price to configurable, Special price remains on configurable product, which leads to confusion on category page, where you see configurable special price instead of option price and on PDP, where you can see both: configurable special price and option price. Which, for instance, never happen in case you create configurable product from the beginning without conversion.
Therefore, when it will be fixed, there will be no ability to see both: special and option price on category page in vanilla magento. And it's correct behaviour.
If You want to see both prices on category page with configurable product, it would be better to implement custom solution, or try to find some 3d-party extensions which may provide such functionality.

Best regards!

Again so many Extensions! Surely this is a basic function! Configurative doesn't mean a price difference! In my case none of my products have a price difference but I want to show they are below RRP!!!!! come on! Frustrating!

mm19pl

@052b-dev thank you for joining. Please accept team invitation here and self-assign the issue.

Hello @devhelp37

Thank you for contribution and collaboration!

We are not able to reproduce this issue on the lates 2.3-develop branch by provided steps.

We are closing this issue due to _branch 2.2-develop was closed and Magento no longer accepts pull requests and issues to the v2.2 release lines to focus all development efforts on v2.3._
See Accepted pull requests and ported code for more details

If you still faced this issue on 2.3 please create a new Issue with all required details according to Issue reporting guidelines

@engcom-Charlie

This bug is 100% reproducible on 2.3.2, 2.3.3, and 2.3.3-p1:

When you have a special price set on a configurable with size variables (so all the simples are the same price), the PDP for the configurable does NOT show that there is a sale price until you select a configurable option.

Not only is it reproducible, but @052b-dev fixed this bug for you.

Read the commit up the thread a little bit here: https://github.com/magento/magento2/issues/15043#ref-commit-b7b4b23

I just applied that bug fix to my m2 repo and it fixed the bug- a configurable with a special price for sizes now shows the sale price before I select a configurable option/size. Here's the PDP working as intended, after applying 052b-dev's fix:

image

Please re-open this ticket and accept the commit that was made to fix this:

https://github.com/magento/magento2/issues/15043#ref-commit-b7b4b23

we fixed this by:

Overriding vendor/magento/module-configurable-product/view/base/templates/product/price/final_price.phtml

  1. Removed the condition to check is product isn't in a list

I believe this has a huge performance impact,

\Magento\ConfigurableProduct\Pricing\Render\FinalPriceBox::hasSpecialPrice loops through all simple products - there is a reason this is not being done on the product list.

The best solution we found so far is this approach: https://magento.stackexchange.com/a/322012/81

Was this page helpful?
0 / 5 - 0 ratings