Compare price code not working in products which has variants

store url: https://bryanandcandy.com/

theme using: Prestige version 5.7.0

I have injected below code to product.meta.liquid for comparing price on product and home page,

( {{ product.compare_at_price_max | minus:product.price | times:100 | divided_by:product.compare_at_price_max }}% off Incl. of Taxes)

this code works on product which is stand alone product, and doesn’t work on products which has variant. screenshot attached.

Hello @Harpal1

Your code is HTML code so this is shown on the first load. If the changed variant, Product Price will be pulled from the js code and there won’t be the HTML you just added.

Option 1: You can reach Prestige theme and they can help you add code

Option 2: Find a developer who specializes in shopify and pitch your needs to them

Option 3: You can use several page builders, there they have the feature you need https://apps.shopify.com/categories/store-design-store-pages

I hope the above is useful to you.

Kind & Best regards,
GemPages Support Team

Hi

This is Victor from PageFly - Shopify Page Builder App

For that, you have to check in your Variants select callback function because on variants selection its works based on Js code,

Check in Asset-.theme.js and find “if(variant)”

But in this case, you are adding the compare price by using custom liquid ( which only shows the first time and will not update ). I think that currently, your theme doesn’t have that feature.
You should contact the theme developer to add this logic handle

Hope this can help you solve the issue

Best regards,

Victor | PageFly

Hello @Harpal1 ,
For this task you need to add custom JavaScript.

hey can help me in it. Just give me article link or write down how to proceed?

hey victor can you help me in it. Product launch is very near. Theme support aint helping. They say its not in there scope.