It worked perfectly, thanks a lot @Dan-From-Ryviu !
You are very welcome!
I have a very similar issue where my products have variants, and often the variants have different prices and this the discount % will often be different. However when I use the suggested code above the % discount is not updated when I select a new variant. Any other suggestions?
Hi @pcebo
Did you use this code?
{%- assign percent = compare_at_price | minus:price | times: 100 | divided_by:compare_at_price | round -%}
Save {{ percent }}%
@Dan-From-Ryviu I did.
The calculated percentage off updates when I refresh the page, but not when I select a new variant. It always displays the percentage off from the last time the page loaded or was refreshed.
What theme are you using? Could you share your product page link so I can check?
@Dan-From-Ryviu here is a link to a preview of the Theme: https://jm011w8lb7b478io-40032075934.shopifypreview.com
One of the best products to see this on are some rotors for example, you can search for RT66 or RT56.
I’m using the Venture theme.
I’ve modified your code a bit so adding “product.” otherwise it was not picking up the values to calculate the %
{%- assign percent = product.compare_at_price | minus:product.price | times: 100 | divided_by:product.compare_at_price | round -%}
Save {{ percent }}%
Could you take screenshots of your price.liquid file?
Can I send collab to request your theme so I can check?
Yeah, of course. What do you need to send the collab request?
I need your Collaborator request code in your store admin > Settings > Users and permission
Ok, just sent it in a private message.
Hey Man,
Can you help me with fix this? So the ,00 will not show anymore. Thanks man!
![]()
Hi @MilanVL
Can I know what code did you use so I can hep you?
