Add A "Add To Cart" button or "View Options" If Variant On Collections Page

SPaco
Tourist
3 1 0

Hi. I can't find a way to do this. I have this for adding the ATC, but need to figure out how I would go about showing different button

for variant products on the collections page.

<form method="post" action="/cart/add">
	<input type="hidden" name="id" value="{{ product.variants.first.id }}" />
      	<input type="submit" value="Add to cart" class="btn" />
</form>

 

This works great for simple products, but how can I do a if else for the "View Options" button. Thanks.

0 Likes