MAKE VENDOR A CLICKABLE LINK IN PRODUCTS PAGE

Highlighted
New Member
6 0 0

Hi all. i would like to make my vendors a clickable link. On the products page it shows the vendors at the top before the title i would like this name to be clickable so when you do you see all the items by that specific vendor. please see image below thanks for the help in advance.

 

Image and video hosting by TinyPic

0 Likes
Highlighted
Astronaut
1890 1 443

You'll need to find the location of the code for that text.  It will probably be in Templates/product.liquid.  You might find:

{{ product.vendor }}

Change it to:

{{ product.vendor | link_to_vendor }}

I hope this helps.

Highlighted
New Member
6 0 0

fantastic it worked. really apriciate the help 

0 Likes
Highlighted
Excursionist
26 0 7

Hello,

One note here, if you are using the latest Debut theme,  {{ product.vendor }} is now under Snippets  > product-price.liquid

 

Highlighted
New Member
5 0 0

Unfortunately it did not work for me.

 

I have collections named the different vendors, but I´m not sure how to link them together.

Anyone having a good solution?

0 Likes
Highlighted

@Ikke-69 

I found this in another forum.

You need to create a collection with the same name as the vendor. Make sure in your collection you edit the SEO so the handle is active. no need to change the URL, just to activate the handle.

Then go to (I'm using Debut) to Snippets product-price.liquid

search for {{ product.vendor }} and replace it with this code

{% assign vendorHandle = product.vendor | handle %}
{% if collections[vendorHandle].products.size > 0 %}
<p><a href="{{ collections[vendorHandle].url }}">{{ collections[vendorHandle].title }}</a></p>
{% else %}
<p>{{ product.vendor | link_to_vendor }}</p>
{% endif %}
-Like and Mark as an Accepted Solution if my reply is helpful
I'm not an expert, these are my own experiences or codes that I gathered from others. I'm using Debut.
I have my own online pet supply store check it out at
PETLANTIS.CA
Highlighted
Excursionist
39 0 10

@Ardi94 wrote:

@Ikke-69 

I found this in another forum.

You need to create a collection with the same name as the vendor. Make sure in your collection you edit the SEO so the handle is active. no need to change the URL, just to activate the handle.

Then go to (I'm using Debut) to Snippets product-price.liquid

search for {{ product.vendor }} and replace it with this code

{% assign vendorHandle = product.vendor | handle %}
{% if collections[vendorHandle].products.size > 0 %}
<p><a href="{{ collections[vendorHandle].url }}">{{ collections[vendorHandle].title }}</a></p>
{% else %}
<p>{{ product.vendor | link_to_vendor }}</p>
{% endif %}

Thank you!! This worked for me.

0 Likes
Highlighted
Tourist
4 0 1

I have tried to find {{ product.vendor }} in my Snippets product-price.liquid code but it is not there. 
Is there something else that would indicate where I put the code for a clickable link to the collection?

0 Likes
Highlighted
Explorer
68 0 12

Hi, 

 

This worked for me when changing on the product page, but not in collections - when I make this change in product-grid-item it completely messes up the arrangement and the photos don't show. I am using the boundless theme. Any help would be much appreciated!fastiadiado.png

 

 

 

0 Likes
Highlighted
New Member
1 0 0

Super helpful thank you for the clarification 

0 Likes