Make product collapsible tab disappear if empty

Solved

Make product collapsible tab disappear if empty

Ked
Shopify Partner
41 2 12

Hi, I would like the the collapsible tabs to disappear in case they are empty since not all of this products have those descriptions included.

 

My store is: https://gqe85oezhfsnd274-50820350128.shopifypreview.com

 

Screenshot 2024-09-13 at 9.26.12 AM.png

Accepted Solutions (4)

Dan-From-Ryviu
Shopify Partner
11754 2305 2488

This is an accepted solution.

Hi @Ked 

You can try to add this code to Custom CSS in Online Store > Themes > Customize > Theme settings and check 

at-collapsible:has(.collapsible-content__inner:empty) {
    display: none;
}

 

- Helpful? Like & Accept solution! - Support me: Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

View solution in original post

Ked
Shopify Partner
41 2 12

This is an accepted solution.

Doing that now, Thanks for your assistance. I'll let you know if it works 

 

View solution in original post

Ked
Shopify Partner
41 2 12

This is an accepted solution.

It works 🎉

Thank you 🙏 

View solution in original post

Dan-From-Ryviu
Shopify Partner
11754 2305 2488

This is an accepted solution.

Very welcome!

- Helpful? Like & Accept solution! - Support me: Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

View solution in original post

Replies 5 (5)

Dan-From-Ryviu
Shopify Partner
11754 2305 2488

This is an accepted solution.

Hi @Ked 

You can try to add this code to Custom CSS in Online Store > Themes > Customize > Theme settings and check 

at-collapsible:has(.collapsible-content__inner:empty) {
    display: none;
}

 

- Helpful? Like & Accept solution! - Support me: Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

Ked
Shopify Partner
41 2 12

This is an accepted solution.

Doing that now, Thanks for your assistance. I'll let you know if it works 

 

Ked
Shopify Partner
41 2 12

This is an accepted solution.

It works 🎉

Thank you 🙏 

Dan-From-Ryviu
Shopify Partner
11754 2305 2488

This is an accepted solution.

Very welcome!

- Helpful? Like & Accept solution! - Support me: Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

Sajat
Shopify Partner
314 35 48

Hi @Ked 

Welcome to Shopify Community.

You can disable the view if the page content on those blocks are empty.

You can change your main-product to achieve this.

Go to Online Store -> Themes -> Customize

Search for the file main-product.liquid.

 

Search for the code  {%- when 'collapsible_tab' -%}

Insert the following code right below the above code.

{% if block.settings.page.content != null %}

& put  {% endif %} right above
{%- when 'quantity_selector' -%}

 

This should do the trick.

Thank you.

Sajat

 

-------------------------------------------------------------------------------------------
If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.