All things Shopify and commerce
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 🙂
Solved! Go to the solution
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 🙂
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 }}
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.
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 %}
Yeah I am almost certain they are assigned correctly. Still no luck, been at for a while now. I might export inventory and reupload
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 🙂
Ah ok great! 😛
Sorry, but I have no idea what could be the problem there.
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024