Change Price

Hey, how can I make it so when someone chooses a variant, the prive changes in the quantity radio

{{ 'product.css' | asset_url | stylesheet_tag }} {% assign productPrice = product.price %}
{% comment %} {% assign product = all_products['ram-chip'] %} {% endcomment %}
{% comment %} {% for image in product.images %}
{% endfor %} {% endcomment %}
{% for image in product.images %} {% endfor %}

{{ product.title }}

{{ productPrice | money }} {% comment %} {{ product.compare_at_price | money }} {% endcomment %} {% comment %} save {{ product.compare_at_price | minus: productPrice | money }} {% endcomment %}

30 DAYS RETURN

1 YEAR WARRANTY

TENSION RELIEF

CIRCULATION BOOST

RELAXATION AID

PAIN REDUCTION

{% assign myProduct = product %}
{% if myProduct %}

{% comment %} {% endcomment %}
{% assign productTwo = productPrice | times: 1.5 | divided_by: 100 | format: “%.2f” %}
{% assign productTwoCompare = productPrice | times: 0.02 | format: “%.2f” %}
{% assign productFive = productPrice | times: 3.2 | divided_by: 100 | format: “%.2f” %}
{% assign productFiveCompare = productPrice | times: 0.05 | format: “%.2f” %}

Quantity:

Buy 1: K{{ productPrice | money_without_currency }}

Buy 2: K{{ productTwo }} K{{ productTwoCompare }}

save K{{ productTwoCompare | minus: productTwo }}

Buy 4: K{{ productFive }} K{{ productFiveCompare }}

save K{{ productFiveCompare | minus: productFive }}
Variants:

{% for variant in product.variants %}

{{ variant.title }}: K{{ variant.price | divided_by: 100 }}
{% endfor %}
{% comment %} {% endcomment %} Add to Cart

{% for payment_type in enabled_payment_types %}
{{ payment_type | payment_type_svg_tag }}
{% endfor %}

Guaranteed safe & secure checkout

{% else %}

Product with key {{ product.key }} not found.

{% endif %}

Returns + -

{{ myProduct.description }}

Hi MohammadAL,

If I’m understanding you correctly, you’d like the values in the quantity variants to dynamically update when specific size variants are selected? The values for quantities are being rendered by Liquid based on how these are set up on your admin, so there’s no native way to have these update based on the relationships between them (ie: Liquid is not aware of the price differing relationships between them). What you’d need to do is capture the values of the variants and set up logic to create new values based on the possible impacts changing one would have on the other, and then customise the existing code to display these new variant values.