2016-03-05 4 views
0

Что-то с моей формой, но я не могу ее исправить, кнопка не добавляет элемент, когда у него есть селектор, в данном случае лента захвата. Смотрите ссылку здесь, которая демонстрирует link:Shopify Добавить в корзину кнопка не работает

<form 
 
       <p class="line-item-property__field"> 
 
    <label>Griptape?</label><br> 
 
    <input required class="required" type="radio" name="properties[Griptape?]" value="Grip it for me"> <span>Grip it for me</span><br> 
 
    <input required class="required" type="radio" name="properties[Griptape?]" value="Just send the grip"> <span>Just send the grip</span><br> 
 
</p> 
 
       <action="/cart/add" method="post" enctype="multipart/form-data" id="AddToCartForm"> 
 
      <select name="id" id="productSelect" class="product-single__variants"> 
 
       {% for variant in product.variants %} 
 
       {% if variant.available %} 
 

 
        <option {% if variant == product.selected_or_first_available_variant %} selected="selected" {% endif %} data-sku="{{ variant.sku }}" value="{{ variant.id }}">{{ variant.title }} - {{ variant.price | money_with_currency }}</option> 
 

 
       {% else %} 
 
        <option disabled="disabled"> 
 
        {{ variant.title }} - {{ 'products.product.sold_out' | t }} 
 
        </option> 
 
       {% endif %} 
 
       {% endfor %} 
 
      </select> 
 

 
      <div class="product-single__quantity{% unless settings.product_quantity_enable %} is-hidden{% endunless %}"> 
 
       <label for="Quantity">{{ 'products.product.quantity' | t }}</label> 
 
       <input type="number" id="Quantity" name="quantity" value="1" min="1" class="quantity-selector"> 
 
      </div> 
 

 
      <button type="submit" name="add" id="AddToCart" class="btn"> 
 
       <span id="AddToCartText">{{ 'products.product.add_to_cart' | t }}</span> 
 
      </button> 
 
      </form>

Помощь высоко ценится.

ответ

0

Исправлено. Для тех, кто в будущем это исправленный код:

<form action="/cart/add" method="post" enctype="multipart/form-data" id="AddToCartForm"> 
 
       <p class="line-item-property__field"> 
 
    <label>Griptape?</label><br> 
 
    <input required class="required" type="radio" name="properties[Griptape?]" value="Grip it for me"> <span>Grip it for me</span><br> 
 
    <input required class="required" type="radio" name="properties[Griptape?]" value="Just send the grip"> <span>Just send the grip</span><br> 
 
</p> 
 

 
      <select name="id" id="productSelect" class="product-single__variants"> 
 
       {% for variant in product.variants %} 
 
       {% if variant.available %} 
 

 
        <option {% if variant == product.selected_or_first_available_variant %} selected="selected" {% endif %} data-sku="{{ variant.sku }}" value="{{ variant.id }}">{{ variant.title }} - {{ variant.price | money_with_currency }}</option> 
 

 
       {% else %} 
 
        <option disabled="disabled"> 
 
        {{ variant.title }} - {{ 'products.product.sold_out' | t }} 
 
        </option> 
 
       {% endif %} 
 
       {% endfor %} 
 
      </select> 
 

 
      <div class="product-single__quantity{% unless settings.product_quantity_enable %} is-hidden{% endunless %}"> 
 
       <label for="Quantity">{{ 'products.product.quantity' | t }}</label> 
 
       <input type="number" id="Quantity" name="quantity" value="1" min="1" class="quantity-selector"> 
 
      </div> 
 

 
      <button type="submit" name="add" id="AddToCart" class="btn"> 
 
       <span id="AddToCartText">{{ 'products.product.add_to_cart' | t }}</span> 
 
      </button> 
 
      </form>

Смежные вопросы