Last active
April 4, 2019 17:38
-
-
Save rotcl/6911e3e26ed1c88898bdf0f3b62f5974 to your computer and use it in GitHub Desktop.
Shopify - Cart notes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
@rotcl | |
{% endcomment %} | |
<p class="cart-attribute__field"> | |
<label for="mensaje-carrito">Mensaje</label> | |
<input type="text" id="mensaje-carrito" name="attributes[mensaje-carrito]" value="{{ cart.attributes["mensaje-carrito"] | |
<textarea id="mensaje-carrito" name="attributes[mensaje-carrito]">{{ cart.attributes["mensaje-carrito"] }}</textarea> | |
<input type="radio" name="attributes[mensaje-carrito]" value="Opcion 1"{% if cart.attributes["mensaje-carrito"] == "Opcion 1" %} checked{% endif %}> <span>Opcion 1</span><br> | |
<input type="radio" name="attributes[mensaje-carrito]" value="Opcion 2"{% if cart.attributes["mensaje-carrito"] == "Opcion 2" %} checked{% endif %}> <span>Opcion 2</span><br> | |
<input type="radio" name="attributes[mensaje-carrito]" value="Opcion 3"{% if cart.attributes["mensaje-carrito"] == "Opcion 3" %} checked{% endif %}> <span>Opcion 3</span><br> | |
<input type="hidden" name="attributes[mensaje-carrito]" value="No"> | |
<input type="checkbox" name="attributes[mensaje-carrito]" value="Yes"{% if cart.attributes["mensaje-carrito"] == "Yes" %} checked{% endif %}> | |
<label>Mensaje checkbox</label> | |
<select id="mensaje-carrito" name="attributes[mensaje-carrito]"> | |
<option value="Opcion 1"{% if cart.attributes["mensaje-carrito"] == "Opcion 1" %} selected{% endif %}>Opcion 1</option> | |
<option value="Opcion 2"{% if cart.attributes["mensaje-carrito"] == "Opcion 2" %} selected{% endif %}>Opcion 2</option> | |
<option value="Opcion 3"{% if cart.attributes["mensaje-carrito"] == "Opcion 3" %} selected{% endif %}>Opcion 3</option> | |
</select> | |
</p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
eCommerce - ⚡️ Shopify ⚡️
¿Cómo agregar una mensaje en el carrito de compra?
Muchas veces nuestros clientes quieren agregar notas especiales dentro del pedido, y las funciones propias de cada plantilla no nos ayudan mucho con esto; en nuestro caso, en Green Glass vimos la necesidad de añadir un elemento distintivo para cuando los clientes buscaran un package de regalo especial, o quisieran mandar un mensaje especial junto a su vaso preferido.
Para incluir el snippet solo basta agregar este comando: {% include 'nota-carrito' %} antes del elemento ''< /form>'' de la sección cart.liquid, o cart-template.liquid; dependiendo de la plantilla que estés ocupando.
Este sería el detalle de cada elemento del código, puedes usar los que te sirvan o sino te llenarás de opciones sin sentido:
Si te peinas con el CSS y Javascript tienes muchas más opciones para hacerlo más bonito o más funcional.