Need help - to know the product variant options selected on cart.liquid

Highlighted
New Member
1 0 0

Hi  

I need help to identify what is required to :

 

if

selected product variant = "Local-3Yrs" then show button 1 

else 

show button 2

 

Have tried the following:

{% if item.line_items contains "Visa/Master" %}

<button type="submit" name="checkout" class="btn cart__checkout">
{{ 'cart.general.checkout' | t }} <span class="icon icon-arrow-right" aria-hidden="true"></span>
</button>
{% endif %}

 

{% if item.product.option-selected_value contains "Visa/Master" %}

<button type="submit" name="checkout" class="btn cart__checkout">
{{ 'cart.general.checkout' | t }} <span class="icon icon-arrow-right" aria-hidden="true"></span>
</button>
{% endif %}

 

{% if item.variant.option3 contains "Visa/Master" %}

<button type="submit" name="checkout" class="btn cart__checkout">
{{ 'cart.general.checkout' | t }} <span class="icon icon-arrow-right" aria-hidden="true"></span>
</button>
{% endif %}

0 Likes
Shopify Expert
128 4 18

You need to do some javascript or jquery 

$(function() {
    $('#row_dim').hide(); 
    $('#type').change(function(){
        if($('#type').val() == 'parcel') {
            $('#row_dim').show(); 
        } else {
            $('#row_dim').hide(); 
        } 
    });
});
Problem Solved? ✔️Accept the solution so you can help others.
* Email: fayyazraza@gmail.com * Skype: fayyaz_raza
0 Likes