Making Vendor Clickable link in products page

Highlighted
New Member
1 0 0

Hi there!

 

We recently changed themes & I've added this update before, but that coding no longer works for this theme.  We wanted to make the vendor clickable from the product page that will take it to that product collection page!  We are using Mr. Parker from underground.  Any assistance would be so greatly appreciated!

 

www.shopwilddove.com

 

Rachel

0 Likes
Highlighted

Hello ,

Go to Online Store->Theme->Edit code ->Sections->product-template.liquid

Search below code:

 

<p class="product-item__vendor small--text-center">{{ product.vendor }}</p>

Replace it with

 

 

<a href="www,google.com"> 
<p class="product-item__vendor small--text-center">{{ product.vendor }}</p>
</a>

Change link where you want to redirect.

 

Want to modify or incorporate custom changes on store, Hire us
If helpful then please Like and Accept Solution .
Email: pallavi@oscprofessionals.com
Skype : oscprofessionals-87
Whats app
Free Website Review and advice for sale from Shopify Conversion Experts | Shopify Private App | Custom Theme Development | Custom Modifications In To Shopify Theme | Shopify SEO ; Digital Marketing & amp | Site Speed Optimization | Performance Site Audit
0 Likes
Highlighted
Shopify Expert
716 54 160

Using this product as an example: https://www.shopwilddove.com/products/ollie-top-speckle-dots-white

 

click brand.png

 

This should do it:

 

1) Find the code that displays the brand, look for the product-vendor class, it's probably in something like product.liquid, or a snippet included in that file.

 

2) Assuming vendor name and collection titles match, you could replace the <em> line with this:

 

{% for collection in collections %}
  {% if collection.title == product.vendor %}
    {% assign brand_link = collection.url %}
    {% break %}
  {% endif %}
{% endfor %}

{% if brand_link %}
  <em><a href="{{ brand_link }}">{{ product.vendor }}</a></em>
{% else %}
  <em>{{ product.vendor }}</em>
{% endif %}

 

 

What this does is cross references your product.vendor (brand name) with collection titles to look for a match. If it finds one, it grabs that collection's url and makes it a clickable link.

 

 

Founder of Speed Boostr (Shopify optimization and dev agency).
Creator of Theme Scientist (A/B testing app).
Creator of Order Automator (app that auto tags + fulfills orders, send emails).
Creator of Tip Jar (add a tip button to your store).
Creator of Shopify Analyzer (free performance analysis tool).
My team also builds custom apps and automated solutions.
Enjoy the adventure!
0 Likes
Highlighted
New Member
1 0 0

Hi team,

 

This is very handy - I am wanting to do the same but am working with a bookstore, so the vendor will be authors, As there are a lot of different authors it would be ideal not to have to go through and create collections for each one manually - is it possible to do the same as you've suggested but having it link to a tag instead of a collection? (I am adding the authors names into the tags),

 

Thanks for your help :)

0 Likes