A Shopify store owner reports a product variant selection bug on their polo t-shirt collection page. When users click the plus (+) button to choose a size, some sizes initially appear disabled. However, once any available size is selected, the previously disabled sizes become available and can be added to cart—allowing customers to purchase unavailable inventory.
Technical Details:
Issue occurs specifically with size variant selection
Problem affects inventory control and could lead to overselling
User provided code snippet showing their variant selection form implementation
Current Status:
The poster is seeking help to resolve this variant availability logic error
No solutions have been provided yet
The issue appears to be in the JavaScript/Liquid code handling variant availability states
Summarized with AI on November 19.
AI used: claude-sonnet-4-5-20250929.
(Men’s Regular Fit Polo T-Shirt With Pocket ) In this product when you choose size by clicking +(plus) button few sizes are disable but when you select one from available size then other disable size variant available and any one can do add to cart.
Please help me out from this.
I have mention the code below.
{% assign id_form = id | append: '-' | append: product.id %}
{% for option in product.options_with_values %}
{% assign option_name = option.name | downcase %}
{% assign option_color_swatch = settings.option_color_swatch | downcase %}
{% if settings.use_color_swatch %}
{% if option_color_swatch contains option_name %}