Liquid, JavaScript, themes, sales channels
I have multiple vendors operating from my site. Each vendor is a 'collection'. I don't want to allow a user to check-out if there is products from more than one collection. If that is the case, then i want to disable the checkout button.
Hi @SquareMarket,
You can use if code to check:
{%- assign check = 0 -%}
{%- assign checkCollection = '' -%}
{%- for item in cart.items -%}
{%- if checkCollection != item.product.collections[0].handle -%}
{%- assign check = check | plus: 1 -%}
{%- assign checkCollection = item.product.collections[0].handle -%}
{%- endif -%}
{%- endfor -%}
{%- if check > 1 -%}
// show button checkout
{%- endif -%}
User | RANK |
---|---|
21 | |
21 | |
10 | |
7 | |
6 |
Explore the 30-30-30 rule, a dynamic social media strategy for new businesses. Learn how t...
By Trevor Sep 20, 2023Discover how to leverage the often overlooked footer of your ecommerce site to gain custom...
By Skye Sep 15, 2023In this blog, we’ll be shining a light on Shopify Partners, Experts, and Affiliates. Who a...
By Imogen Sep 13, 2023