簡體   English   中英

Shopify添加到購物車按鈕不起作用

[英]Shopify Add to Cart button not working

我的表單有問題,但我無法修復,如果按鈕具有選擇器,則按鈕不會添加任何項,在本例中為膠帶。 請參閱此處的鏈接,它演示了鏈接

  <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> 

幫助非常感謝。

固定。 對於以后的任何人,這是更正的代碼:

 <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> 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM