How can I hide collapsible rows on specific products using Dawn theme?

Hi
I want to know how can I hide collapsible rows for a product on my store and show it in other different product.
I use Dawn theme.

In the first picture, I want to keep the collapsible rows on this product

In the second picture, I want to remove the collapsible rows on this product

1 Like

Hi @Troy-sweden ,

You can try this code by following these steps:

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Search file theme.liquid

Step 3: Paste the below code at the bottom of the file → Save

{% if handle contains "product" and handle contains "hair_growth"

{% endif %}

Hope my solution works perfectly for you!

Best regards,

Oliver | PageFly

sorry man but it appears there is an error

Liquid syntax error line 346 if tag was never closed

Hello @Troy-sweden ,

Navigate to Settings → Custom Data → Products → Add Definition. Then type the desired name and select the type. For the title, choose “Single Line Text”, and for the content, choose “Multi-line Text”. You need to create two entries with different unique names.

Navigate to Online Store → Themes → Find the file named “main-product.liquid” using the search bar. Locate the code block containing {%- when ‘collapsible_tab’ -%} and replace it with the provided code.

Replace Code:


                  
                

To:

{%- if block.settings.heading != blank or block.settings.content != blank or block.settings.page.content != blank -%}    
                
                  
                

              {%- endif -%}
                            
               {% if product.metafields.custom.collabsible_title_1 != blank or product.metafields.custom.collabsible_content_1 != blank %}
               
                  
                

              {%- endif -%}

                 {% if product.metafields.custom.collabsible_title_2 != blank or product.metafields.custom.collabsible_content_2 != blank %}           
              
                  
                

               {%- endif -%}

Navigate to Online Store → Products → Select the product. Scroll to the bottom of the page and locate the section for metafields. If you want to display collapsible data, you can add the necessary metafields here.