Display loyalty points info for variants with different prices

I am using the Symmetry theme on my Shopify store

I have installed the latest Shopify OS 2.0 version of the Symmetry theme v5.1.0

Currently it is unpublished on my Shopify store. I plan to publish it soon

I am running a loyalty program on my Shopify store

I want more customers to engage with the loyalty program running on my Shopify store so I have set up this block to inform customers how much loyalty points they can earn if they order a particular product

Preview Link

I have set up this block using the following HTML code:

Buying this earns {{ product.price | times: 0.02 | round: 0 }} loyalty points

The loyalty points formula is to multiply the product price (in Pakistani Rupees) by 2

It is working correctly for products which don’t have variants with different prices

This code doesn’t work correctly if a product has 2 or more variants with different prices

If the first variant is for PKR Rs 1000 and the second variant is for PKR Rs 500, the block displays 2000 loyalty points for both the variants.

So this code needs to be modified to make it work for products which have variants with different prices, such as the following product

I have tried modifying this code with my limiting coding knowledge. Regrettably it didn’t work

I hope someone can help me to make this work

Note: I have made these changes in the unpublished version of Symmetry theme on my Shopify store

Please reach out to me at jessica.swatz@nigostudio.com And we will help you out!