shop.vendors not pulling all vendors from inventory

Solved
Highlighted
Tourist
4 1 0

Hello Shopify community ! This will be my first post Hope someone can help me out here.

Im trying to setup a page where I can render a list of vendors. Pretty simple.

I used this code below:

 

<ul>
    {% for vendor in shop.vendors %}
      <li>{{ vendor }}</li>
    {% endfor %}
</ul>

 

This only renders one of my vendors which is actually a placeholder as we update more. Ive added multiple vendors to different products and it still only pulls the one vendor. I think this may be an issue with the way im setting vendors up and not the code itself?

Thanks for any help

0 Likes
Highlighted

At the a first sight the code seems correct.

Are you sure that the code is ok and that there are not liquid errors?

Try this

Vendors: {{ shop.vendors.size }}

 

• If the problem is solved remember to click ✅ to Accept Solution
• Press Like, if the answer was helpful
• Shopify/Shopify Plus custom development, optimization and consulting. You can hire me here.
Highlighted
Tourist
4 1 0

thanks for your response!

Tried that and it definitely is only showing 1 vendor in my vendor's object. I'm really stumped as to where all my other ones are.

0 Likes
Highlighted

That's so strange. Did you assign vendors to products?

If yes, try to create a collection called All with all products inside and test this code

 

{% assign all = collections['all'] %}

<h2>Total Vendors: {{ all.all_vendors.size }}</h2>

{% for v in all.all_vendors %}
<div style="margin-bottom: 5px;">
	{{ v }}
	(<a href="{{ frontend }}/collections/vendors?q={{ v | url_param_escape }}" target="_blank">View</a>
</div>
{% endfor %}
• If the problem is solved remember to click ✅ to Accept Solution
• Press Like, if the answer was helpful
• Shopify/Shopify Plus custom development, optimization and consulting. You can hire me here.
Tourist
4 1 0

Yeah I am almost certain they are assigned correctly. Still no luck, been at for a while now. I might export inventory and reupload 

 Screen Shot 2020-10-01 at 4.40.49 PM.png

0 Likes
Highlighted
Tourist
4 1 0

This is an accepted solution.

Figured it out after reuploading, the majority of my inventory was labeled unavailable, once I switched them all on my vendors started showing up. Thanks for the help! appreciate it

0 Likes
Highlighted

Sorry, but I have no idea what could be the problem there.

• If the problem is solved remember to click ✅ to Accept Solution
• Press Like, if the answer was helpful
• Shopify/Shopify Plus custom development, optimization and consulting. You can hire me here.
0 Likes
Highlighted

Ah ok great!

• If the problem is solved remember to click ✅ to Accept Solution
• Press Like, if the answer was helpful
• Shopify/Shopify Plus custom development, optimization and consulting. You can hire me here.
0 Likes