Accepting credit cards, warehouses, and shipping and fulfilling orders
Hello,
We sell items from multiple vendors and would like to be able to show a message on the cart page if the items in the cart are from different vendors. How would this be possible?
Hello @giveitalabel you can contact me if you need the following customized for you, contact info in sig.
Always backup themes before changing code.
Try something like the following, which may need tweaking
{% assign multiple_vendors = false %}
{% assign current_vendor = cart.items.first.vendor %}
{%- for item in cart.items -%}
{% if current_vendor != item.vendor %}{% assign multiple_vendors = true%} {%break%}{% endif %}
{% assign current_vendor = item.vendor %}
{%- endfor -%}
it may be items.first.product.vendor instead of items.first.vendor
You'd place the code in the relevant area in the themes cart template, or for OS2.0 theme use a liquid block|section.
Advanced note: yes it could probably be done cleaner with the map filter and an if condition instead of a forloop but this is simpler for most people.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025