I would like to disable my checkout button if there is products from more than 1 collection in the cart.
this is a pseudo code of what I am looking for, but i couldn’t find out you specifically count the number of collections in a cart. I am not very proficient with liquid, and despite using https://www.shopify.ca/partners/shopify-cheat-sheet I could not figure it out
I want to:
-
create variable for Set of the collections
-
iterate through the items in the cart
-add the collection of the item to the Set
-If there is >1 collection in the set, disable the button