Removing Quantity Selector on Cart page when current_variant.inventory_quantity is equal to 1.

I wanted to know how to remove the quantity selector on cart page when I have one product in the inventory available. If there is more than one product in the inventory, I want the quantity selector to show. I believe I need to edit this part of the code:


              {% if current_variant.inventory_quantity == 1 %}
              NONE

              {% else %}              
              
                
                
                
              

              {% endif %}
            

I added

{% if current_variant.inventory_quantity == 1 %}

NONE
{% else %}

but it is not working.

Thanks for your help!

Hello, @dhsk11

Use

{% if item.variant.inventory_quantity == 1 %}

Instead of

{% if current_variant.inventory_quantity == 1 %}

1 Like

Thank you very much! That worked perfectly.