d
Topic
Kevin Compton Shopify Partner
Posts:
25
July 31, 2012

product logic - if variations exist This post is outdated

I want to be able to swap the buy button out with a view button on the collection view if any variations at all exist. So far I only see product.price_varies, close but no cigar. Some of the variations won't change price but nonetheless need to be selected before the item can be added to the cart.

i
Replies
Kevin Compton Shopify Partner
Posts:
25
July 31, 2012

Accomplished it this way (let me know if this has any loop holes in it but it seems to work great)

 

 

{% if product.options.size > 1 %}
   <!-- view product button goes here -->
{% else %}
   <!-- add to cart button goes here -->
{% endif %}

My problem now is that the add to cart button doesn't seem to be functioning on the collection view, any ideas why??

 

Posts:
670
July 31, 2012

is the entire add to cart form there? it needs to be (not just the button)..

I'm a million different people
Kevin Compton Shopify Partner
Posts:
25
August 01, 2012

It is. And adding to the cart works but it does not forward the user to the cart after it is added. Works fine on the product page