Correct Variant won't Add to Cart on Modal

Highlighted
New Member
1 0 0

Help!

On this page (https://revolashion.com/pages/course-schedule) if you click on "reserve a seat" and then choose the "partial" variant and add it to the cart, the "full" variant is added instead. When I change the variant order on the product page, whatever is listed first is the variant that is added to the cart. I would like to add the "selected" variant to the cart. Here is my code, wondering if anyone can help.

{%- form 'product', product, class: 'ProductForm' -%}
  <div class="ProductForm__Variants">

      <div class="ProductForm__Option">
        <div class="Select Select--primary">
          {%- include 'icon' with 'select-arrow' -%}
          <select id="product-select-{{ product.id }}" name="id" title="Variant">
            {%- for variant in product.variants -%}
              <option {% if variant == selected_variant %}selected="selected"{% endif %} {% unless variant.available %}disabled="disabled"{% endunless %} value="{{ variant.id }}" data-sku="{{ variant.sku }}">{{ variant.title }} - {{ variant.price | money }}</option>
            {%- endfor -%}
          </select>
        </div>
      </div>
      <input type="hidden" name="id" data-sku="{{ selected_variant.sku }}" value="{{ selected_variant.id }}">

      <input type="hidden" name="quantity" value="1">
0 Likes