liquid - Shopify: Product variant id's are outputting as literal strings, not numbers -
thanks in advance taking time read this.
i'm developing "test shop" through partners account. in shop working expected accept product.liquid file. of variant id's products outputting literal strings, not numbers. using option_selection.js file jquery solution build multiple drop downs product.
and of course since no id passed cart action "we not able add item shopping cart because no variant id passed us." so, thoughts on solution or what's causing appreciated.
below sample of variant loop in place:
<form id="add-to-cart" action="/cart/add" method="post" > <select id="variant-select"> <option>product options</option> {% variant in product.variants %} <option value="{{ variant.id }}">{{variant.title }} {{ variant.price | money}}</option> {% endfor %} </select> <input type="image" name="add" value="purchase" id="purchase" src="{{ 'purchase.png' | asset_url}}" /> <span id="product-price">{{ product.price | money }}</span> </form>
and here xhtml output. note: result 1 of drop downs, there 2 more have similar output.
<div class="selector-wrapper"> <label for="variant-select-option-0">size</label> <select class="single-option-selector" id="variant-select-option-0"> <option value="small">small</option> <option value="medium">medium</option> <option value="large">large</option> <option value="x-large">x-large</option> </select> </div>
to add little more context issue, below sample of drop down output prior using jquery solution create multiple drop downs. still using same variant loop above , still produces same error. variant id's seem longer normal...
<select id="variant-select"> <option>product options</option> <option value="105062422">small / black / men's $19.00</option> <option value="105062492">medium / black / men's $19.00</option> <option value="105062522">large / black / men's $19.00</option> <option value="105062552">x-large / black / men's $19.00</option> <option value="105062602">small / blue / men's $19.00</option> <option value="105062632">medium / blue / men's $19.00</option> <option value="105062702">large / blue / men's $19.00</option> <option value="105062732">x-large / blue / men's $19.00</option> <option value="105062802">small / black / women's $19.00</option> </select>
below dev link , password.
http://terry-inc6406.myshopify.com/products/featured-product-1
pass: yhc
thanks again! , sorry such long first post
thanks caroline @ shopify. pointed out malformed markup, adding name="id" select element fixed it.
Comments
Post a Comment