bootic: custom show_add_to_cart

{% assign show_add_to_cart = true %} {% if product.any_available %} {% for collection in product.collections %} {% if collection.slug == 'impresion' or collection.slug == 'fotoproductos' %} {% assign show_add_to_cart = false %} {% endif %} {% endfor %} {% endif %} {% if show_add_to_cart == false or product.stock > 5 %} <p class="units-in-stock">En stock</p> {% elsif product.stock > 0 %} <p class="units-in-stock low-stock">Sólo {{ product.stock }} disponibles</p> {% elsif product.has_unlimited_stock %} <p class="units-in-stock pre-sale">Disponible para pre-venta</p> {% else %} <p class="units-in-stock no-stock">Agotado</p> {% endif %} {% if show_add_to_cart %} <div id="add_cart"> {% add_to_cart %} </div> {% else %} <div id="add_cart"> <form class="add_to_cart" action='https://produccion.migo.cl/prints' method='post'> <input name="return_to" type="hidden" value="https://www.migo.cl/products/{{ product.slug }}"> {% if product.variants.size > 1 %} <ul class="variants"> {% for variant in product.variants %} <li class="bootic_variant available odd av-variant-1"> <input type="radio" name="variant_id" value="{{ variant.id }}" id="{{ variant.id }}" checked> <label for="{{ variant.id }}"> <span class="bootic_variant_title">{{ variant.title }}</span> </label> </li> {% endfor %} </ul> {% else %} <input type="hidden" name="variant_id" value={{product.variants.first.id}} /> {% endif %} <input type="hidden" value="{{ cart.code }}" /> <input type="submit" class="submit primary bootic_button" value="Subir fotos" /> </form> </div> {% endif %}

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.