Problem with quantity limit to add to cart

Antonio87
Visitor
2 0 0

Good morning,
I have a problem with the theme

There is no quantity lock present in inventory

I would like the number of available products to appear on the product page and that it is not possible to add quantities to the cart that exceed the available quantities.

I would also like it to be possible for this limit not to be bypassed during checkout and for a quantity limit message to always appear

I'll show you the code I have and if anyone can help me with this modification

 

{%- if product.variants.size == 0 -%}
{%- assign id = ''  -%}
{%- assign checked = ''  -%}
{%- else -%}
{%- for variant in product.variants -%}
{%- if variant.available -%}
{%- assign id = variant.id  -%}
{%- assign checked = 'checked'  -%}
{% break %}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
 
<div class="group_products-item {%- if id == '' -%}disable{%- endif -%}">
  
  <input class="group_product-item" type="checkbox" value="{{id}}" {{checked}}>
  <div>
    <img width="auto" height="auto" src="{{product.featured_media | img_url: '200x' }}" alt="{{ product.title | escape }}">
    {% render 'quickview-button', handle: product.handle %}
  </div>
  <a href="{{product.handle}}">{{product.title}}</a>
</div>

 

Thank you

Replies 0 (0)