A button to link back to a certain tagged collection from the product page.

Highlighted
Tourist
3 0 1

Hello Everybody

 

I'm looking to add a button on my product page that will look for the tags A, B , C or D on a product and then link back to that page. I tried something like this but I'm quite new to liquid and i'm fairly sure I will need an extra line for the tags to be placed into a variable.

{% if product.tags == 'A' %}
<a href="collection/A" class="btn shop_multiple" >Click Here to shop multiple colors!</a>
{%  if product.tags == 'B'  %}
<a href="collection/B" class="btn shop_multiple" >Click Here to shop multiple colors!</a>
{% else %}
<a href=" if product.tags == 'C' " class="btn shop_multiple" >Click Here to shop multiple colors!</a>
{% endif %}

 

Any guidance very much appreciated. TIA!!

1 Like

Hello

Go to Online Store-> Themes -> Sections -> product-template.liquid file

& add following code where you want to add Back button.

<a href="javascript&colon;history.go(-1)">Click here to shop multiple colors</a>

 

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
Custom Shopify Private App | Custom Theme Development | Custom Modifications In To Shopify Theme | Digital Marketing | Site Speed Optimization | Web Development
0 Likes
Tourist
3 0 1

Hello oscprossional,

 

Sadly this does not work, This just directs me back to the previous page. I need to be difrected to the collection page limited collection page associated with the case.

 

https://www.the-good-case.com/  - This is the site for reference! 

0 Likes

Hello 

The above solution works for  back to view collection from where product comes.
If you want to show multiple collection links by tags you have to customize product-template.liquid file.

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
Custom Shopify Private App | Custom Theme Development | Custom Modifications In To Shopify Theme | Digital Marketing | Site Speed Optimization | Web Development
0 Likes
Tourist
3 0 1

Ah I see, Ideally I onyl want it to link back to the tagged collection that has the other case colours not the phone type cariations.

0 Likes