The “Sale” block doesn’t seem to work. i followed the instructions: setup the special price and from and to, but nothing seems to work. Same products don’t have a “Sale” label in the catalog and don’t show original price crossed. “New” products works fine. All my products are configurable and I’m using Magento 2.2.1. Any idea what could cause this issue?
Thanks for your feedback but with Configurable Product on the magento2, you will can't see original price and sale label, you can see original price when you select option. This is not theme error, it is a default magento2 feature.
This makes this feature pretty much useless for most apparel/footwear stores as most items have configurations. May I ask why is it not possible to apply sale label to configurable products?
Is there any other way to apply a sale label to certain products?
Thank you for your support, but this didn't work for me. Can I confirm I'm doing this correctly? Is it enough to just set the special price and from and to dates? Am I required to perform some additional steps?
It still doesn't work. For configurable products that have a special price $price = $product->getFinalPrice(); always returns 0.0000. However, I tried using $price = $product->getPriceInfo()->getPrice('regular_price')->getValue(); which returns the correct price. After adding this code sale label appears even on configurable products.
In order to display the original price crossed I just added this CSS:
The “Sale” block doesn’t seem to work. i followed the instructions: setup the special price and from and to, but nothing seems to work. Same products don’t have a “Sale” label in the catalog and don’t show original price crossed. “New” products works fine. All my products are configurable and I’m using Magento 2.2.1. Any idea what could cause this issue?
Hi
Thanks for your feedback but with Configurable Product on the magento2, you will can't see original price and sale label, you can see original price when you select option. This is not theme error, it is a default magento2 feature.
This makes this feature pretty much useless for most apparel/footwear stores as most items have configurations. May I ask why is it not possible to apply sale label to configurable products?
Is there any other way to apply a sale label to certain products?
Hi
I think that I can help to show the sale label, can you please provide your site info ( admin account and ftp access detail ) I will check for you
Thanks for your offer. Unfortunately I'm not allowed to do this. Are you, by any chance, able to assist me this way? Magento version is 2.2.1
Hi
So please try to edit Data.php in app/code/MGS/Mpanel/Helper/ folder
(Around line 500) :
// Sale label
Replace
$price = $product->getPrice();
$finalPrice = $product->getFinalPrice();
with
$price = $product->getFinalPrice();
$finalPrice = $product->getPriceInfo()->getPrice('final_price')->getValue();
Then refesh cache and try again
Also note to back the file up before change
Unfortunately this didn't work. Any other suggestions?
Hi,
I tried on my local and this works good. Please try again
Open: app/code/MGS/Mpanel/Helper/Data.php
Replace
$price = $product->getPrice();
$finalPrice = $product->getFinalPrice();
with
$price = $product->getFinalPrice();
$finalPrice = $product->getPriceInfo()->getPrice('final_price')->getValue();
Please clean cache and check by private browser
Best regards!
Thank you for your support, but this didn't work for me. Can I confirm I'm doing this correctly? Is it enough to just set the special price and from and to dates? Am I required to perform some additional steps?
Hi,
I tried to test on my local and it is working exactly.
Can you install the theme on the demo sever, so i will easily check for you.
Best regards!
It still doesn't work. For configurable products that have a special price $price = $product->getFinalPrice(); always returns 0.0000. However, I tried using $price = $product->getPriceInfo()->getPrice('regular_price')->getValue(); which returns the correct price. After adding this code sale label appears even on configurable products.
In order to display the original price crossed I just added this CSS:
.old-price {
display: inline !important;
}
Hello, same problem, you solve it ?
Can you give me more details how you solve your problem , please ?
Hi,
Thanks for feedback, I will reinstall the theme and send the video of the issue to you, please wait
Best regards!
Hi,
Please update the patch to your site
Best regards!