How to show tabs on...
 
Notifications
Clear all

How to show tabs only for a specific collection?

11 Posts
2 Users
0 Reactions
1,015 Views
(@yg)
Eminent Member
Joined: 3 years ago
Posts: 31
Topic starter  

I couldn't find the button"show tabs only on this collection" 🙄 


 


   
Quote
plaktheme
(@plaktheme)
Reputable Member
Joined: 5 years ago
Posts: 0
 

Hi @yg,

Katrine here from Plak Theme support,

Restricting tabs to only a specific collection has been deprecated since Plak 2.3, because sometimes it doesn't work on an unpublished theme and it was confusing for our merchants.

If you still would like to show the tabs for only one collection, just reply to this thread, and I will show you the steps to do it via changing some codes

Kind regards,
Katrine

Katrine | Technical support at Plak, Scrowp & Vantout
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as a Solved Solution


   
ReplyQuote
(@yg)
Eminent Member
Joined: 3 years ago
Posts: 31
Topic starter  

@plaktheme I want to realize this function, please tell me how to do it?


   
ReplyQuote
plaktheme
(@plaktheme)
Reputable Member
Joined: 5 years ago
Posts: 0
 
Posted by: @yg

@plaktheme I want to realize this function, please tell me how to do it?

Great ! Please follow these steps in order to add a collection filter to the product tabs.

  • From your Shopify dashboard, click Online store > Actions > Edit code
  • Open the file product-template.liquid
  • Just before this code
],
"blocks": [
  • Add this one
{
"id": "filter-tabs",
"type": "collection",
"label": "show tabs on this collection only"
}
  • Click Save

  • Now open the file product-tabs.liquid
  • After the closing tags </style>, add this code
{% assign filter-tabs-show = collections[section.settings.filter-tabs] %}
{% assign foundProduct = false %}
{% assign currentProduct = product.title %}
{% if filter-tabs-show.products.size > 0 %}
{% for product in filter-tabs-show.products %}
{% if product.title == currentProduct %}
{% assign foundProduct = true %}
{% endif %}
{% endfor %}
{% endif %}
{% if foundProduct == true %}

  • Just before the last line beginning with <script, add this code
{% endif %}
  • Click Save

 

Now on the product page from the theme editor, you will see the option (show tabs only on this collection), chose the collection where you would like the tabs to appear to to and click Save

 

If you have any other questions or request, feel free to get back to me again

Kind regards,
Katrine

Katrine | Technical support at Plak, Scrowp & Vantout
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as a Solved Solution


   
ReplyQuote
(@yg)
Eminent Member
Joined: 3 years ago
Posts: 31
Topic starter  

@plaktheme Hi, I meet a wrong in the first step.

 I can't save the code.


   
ReplyQuote
plaktheme
(@plaktheme)
Reputable Member
Joined: 5 years ago
Posts: 0
 
Posted by: @yg

@plaktheme Hi, I meet a wrong in the first step.

 I can't save the code.

Hi @yg

Add a comma as shown in the screenshot below and it should work now 🙂

 

Let me know if you encounter nay other issue ^^

Katrine

Katrine | Technical support at Plak, Scrowp & Vantout
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as a Solved Solution


   
ReplyQuote
(@yg)
Eminent Member
Joined: 3 years ago
Posts: 31
Topic starter  

@plaktheme Thanks, it worked. Is there any way to display these four tabs in four different collection products? The first tab is only displayed in collection 1, and the second tab is only displayed in collection 2.

 


   
ReplyQuote
plaktheme
(@plaktheme)
Reputable Member
Joined: 5 years ago
Posts: 0
 
Posted by: @yg

@plaktheme Thanks, it worked. Is there any way to display these four tabs in four different collection products? The first tab is only displayed in collection 1, and the second tab is only displayed in collection 2.

 

You can show 4 different tabs on different products by creating 4 product templates :

Spoiler
Create the new template
  • From your Shopify dashboard, click Online store > Actions > Templates > Add a new template

  • Chose Create a new template for product; template type : liquid
  • Name the file for example : template1
  • Click Create template
  • On the newly created template, change this code
{% section 'product-template' %}
  • to this one
{% section 'product-template1' %}
  • Click Save

  • Under Sections, click create a new section
  • Name the section : product-template1

  • Open the file product-template.liquid
  • Copy all its content

  • Paste the content to the new product template created product-template1.liquid

  • Click Save
Spoiler
Assign the new template to a product
  • Go to the product where you would like to have a different product tabs, options, ....
  • On the right, under Theme template, chose template1

  • Click Save
Spoiler
Modify the product content
  • On the theme editor, chose the product
  • Modify the content, tabs, product options, ....
  • Click Save

 

This product will have now its own content and are different from the standard template.

If you would like to add other template, repeat the same process by giving the new templates new names, for ex : product-template2, product-template3, product-template4, ....etc

Let me know if you have any other questions

Kind regards,
Katrine

Katrine | Technical support at Plak, Scrowp & Vantout
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as a Solved Solution


   
ReplyQuote
(@yg)
Eminent Member
Joined: 3 years ago
Posts: 31
Topic starter  

@plaktheme Thanks, that's what I need. But products with new templates created using this method will not show blurry coupons. How to solve this problem?


 


   
ReplyQuote
(@yg)
Eminent Member
Joined: 3 years ago
Posts: 31
Topic starter  

Another very serious problem is that there is only one product picture left, and all the options are only one. It is most products, and some of them remain the same. Why does this happen?



 


   
ReplyQuote
plaktheme
(@plaktheme)
Reputable Member
Joined: 5 years ago
Posts: 0
 
Posted by: @yg

@plaktheme Thanks, that's what I need. But products with new templates created using this method will not show blurry coupons. How to solve this problem?


 

Did you test the new template on a live theme or on an unpublished version ?

Katrine | Technical support at Plak, Scrowp & Vantout
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as a Solved Solution


   
ReplyQuote
Share:

Welcome to the Shopify Forum Community provided by Plak ThemeLLC, a place where you can discuss about eCommerce and Shopify, solve technical issues, get help with Shopify Design, Apps integration, Marketing, Facebooks ad, Google ads and more.

Before posting, we invite you to read and follow the forum rules | We also support any questions related to Free Shopify themes :Dawn, Express, Minimal, Brooklyn, Narrative, Supply, Debut, Venture, Boundless and Simple