Product Page - Custom Liquid help

Topic summary

A user is attempting to display dynamic loyalty points on a product page that update based on the selected variant’s price. They’re using custom Liquid code that calculates points (10 points per 1 AED spent) and displays the result.

Current Issue:
The points calculation displays correctly on initial page load but doesn’t update when customers select different product variants.

Technical Details:

  • Using the Impact theme (previously used Focal where it worked)
  • Current code uses product.selected_or_first_available_variant.price divided by 100
  • Screenshots show the static points display

Proposed Solution:
A respondent suggests hooking into the theme’s “Variant Changed” event to trigger recalculation when variants are selected, noting this approach is doable across different themes.

The discussion remains open as the original poster hasn’t confirmed implementation of the suggested solution.

Summarized with AI on November 18. AI used: claude-sonnet-4-5-20250929.

Hi,

is there any way to add the points count that may earn from purchasing specific products t_o be changed based on the variant selection.?_

{{ product.selected_or_first_available_variant.price | divided_by: 100 }} Points will be added to your account when you purchase this product.
Log in to claim points.

  • I am using the above snippet code and it gives me the result but unfortunately, its not change when the variant selection change!

and please note that i am giving 10 points for each AED 1 spend on the store.

Hi @Moe92

What theme are you using? You’d need to hook into the “Variant Changed” event in code, get the price then do the calculation again. It is doable in all cases!

Hi, thanks for your kind reply, I am using impact theme, I was using focal and it was probably working. what should I do?