Shopify themes, liquid, logos, and UX
Hello, so I have a product with variant sizes, i have a variant price and a compare at price. They both seem to work, i added with code the price difference between those 2 and it also works but when I change size variants the price difference is not changing but the other 2 change correctly. If I refresh the product at the current variant it correctly displays it but if I change size again it keeps the previous rendered price difference. This is the code for the price difference
{% if variant.compare_at_price > 0 %}
{% assign price_difference = variant.compare_at_price | minus: variant.price %}
<span class="price-difference"><p> κερδίζετε {{ price_difference | money }}</p></span>
<style>
sale-price {
white-space: break-spaces !important;
}
</style>
{%- endif -%}
I've also tried to put it out of <p> and then out of <span> but it didn't change much. I've also tried to refresh the span with JavaScript whenever there was a change in the URL (when I click other sizes) and I also tried calling it with "render" and "capture". Any ideas? Thank you in advance.
Hi @Bill53
How are you?
for this have to add JS code according to theme to update the price acccording variant on change,
It will took 2-3 Hours approx.
Please let me know if need any help from my end.
Contact info in signature.
Thanks
Laddi
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024