bootic: add_to_cart variantes con select

<form action="{{ add_to_cart_url }}" method="post" data-bootic-cart-add="add" data-bootic-productid="{{ product.id }}"> <input class="talla-related" type="hidden" name="cart_item[product_id]" value="{{ product.id }}" /> <select name="cart_item[variant_id]" id="variante"> <option name="-" value="-" title="-" disabled="disabled" selected="selected">Seleccionar Talla</option> {% for variant in product.variants %} <option id="i-{{ variant.id }}" value="{{ variant.id }}" {% unless variant.is_available %} disabled="disabled" {% endunless %}> {{ variant.title }} </option> <label for="i-{{ variant.id }}">{{ variant.title }}</label> {% endfor %} </select> <p> <input id="cantidad-related" type="text" name="cart_item[quantity]" value="1" /> {% if product.variants.size == 1 %} <input type="hidden" name="cart_item[variant_id]" value="{{ product.variants.first.id }}" /> {% else %} {% endif %} <input id="agregar" type="submit" value="Comprar" /> <input class="submit" value="" data-in-cart="en el carro" data-out-of-stock="No hay más disponibles."/> </p> </form>

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.