Hi there,
We added this script to our product listings so text appears next to the pricing.
.product__price::after {
content: "*Price includes taxes & postage";
font-size:15px;
display: block;
}
However, if an item is on sale, it ends up duplicating it twice.
How can we fix this problem so it only appears once?
Many thanks!
Hello, which Shopify theme are you using?
Can you also provide the link to the website, so that I can take a look and suggest a solution?
The problem is caused by the fact that, when a product is on sale, there are 2 prices displayed that use the same class you used in your code.
I don’t like it, because I would prefer much more solving it in the template using Liquid, but you can add this CSS at the end of your theme.css to do the trick:
And remove your previous code.
.product__price-savings:after {
content: "*Price includes taxes & postage";
font-size: 15px;
display: block;
color: #000;
}
.product__price-savings {
display: block !important;
}
Another option, maybe cleaner.
.product__price:after {
content: "*Price includes taxes & postage";
font-size: 15px;
display: block;
}
.product__price.product__price--compare:after {
content: "";
}