Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
Hi
How do I make it possible so a product only can be bought when a specific product / collection already is in the cart?
Possible to do it with product tags?
E.g. if product tag "SILVER" is in the cart, you can buy this specific product.
forgot to mention I am using the Minimal theme
This is how I did it, if there are products from the following collections, it should show me the buy button, and if there is no one of these collections it should not show me
<!--Boton Comprar-->
{% for item in cart.items limit:1%}
{% assign found_collection = false %}
{% for collection in item.product.collections %}
{% if found_collection == false and collection.title == 'Acabados' or found_collection == false and collection.title == 'Combo' %}
{% assign found_collection = true %}
{% endif %}
{% endfor %}
{% if found_collection %}
<input type="submit" name="checkout" value="Comprar ahora" class="btn btn-primary aparece-solamente-ventas"/>
{% endif %}
{% endfor %}
User | RANK |
---|---|
239 | |
98 | |
88 | |
51 | |
42 |