html - Add to Cart button missing ID -
my add cart button on shopify front page not getting added cart. gives error when clicking:parameter missing or invalid: required parameter missing or invalid: id
the form looks this:
<form action="/cart" method="post" enctype="multipart/form-data" id="addtocartform" value="{{ item.variant.id }}"> <span id="productprice" class="h1 price" itemprop="price"> {{ current_variant.price | money }} </span> {% if product.compare_at_price_max > product.price %} <p id="compareprice" class="h3 price"> {{ current_variant.compare_at_price | money }} </p> {% endif %} <div class="form__row" style="margin-top: 10px"> <select name="id" id="productselect" class="product-single__variants"> {% variant in product.variants %} {% if variant. available %} <option {% if variant.id == current_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="form__column quantity-selector"> <label for="antal" class="quantity-selector">{{ 'products.product.quantity' | t }}</label> <input type="number" id="antal" name="antal" value="1" min="1" class="qty-remove-defaults quantity-selector"> </div> <div class="form__column"> <button href="/cart" type="send" name="tilføj" id="addtocart" class="btn btn--fill btn--regular btn--color"> <span id="addtocarttext">{{ 'products.product.add_to_cart' | t }}</span> </button> </div> </div> </form>
is because it's missing variant.id paraemeter? liquid knowledge little.
Comments
Post a Comment