Make product collapsible tab disappear if empty

Solved

Make product collapsible tab disappear if empty

Ked
Shopify Partner
16 2 4

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
9637 1931 1967

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 and Accept solution! Support me! Buy me coffee
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Ryviu: Aliexpress Reviews - AliExpress Reviews Importer, one-click import aliexpress reviews, export reviews to CSV file.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

View solution in original post

Ked
Shopify Partner
16 2 4

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
16 2 4

This is an accepted solution.

It works 🎉

Thank you 🙏 

View solution in original post

Dan-From-Ryviu
Shopify Partner
9637 1931 1967

This is an accepted solution.

Very welcome!

- Helpful? Like and Accept solution! Support me! Buy me coffee
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Ryviu: Aliexpress Reviews - AliExpress Reviews Importer, one-click import aliexpress reviews, export reviews to CSV file.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

View solution in original post

Replies 5 (5)

Dan-From-Ryviu
Shopify Partner
9637 1931 1967

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 and Accept solution! Support me! Buy me coffee
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Ryviu: Aliexpress Reviews - AliExpress Reviews Importer, one-click import aliexpress reviews, export reviews to CSV file.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

Ked
Shopify Partner
16 2 4

This is an accepted solution.

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

 

Ked
Shopify Partner
16 2 4

This is an accepted solution.

It works 🎉

Thank you 🙏 

Dan-From-Ryviu
Shopify Partner
9637 1931 1967

This is an accepted solution.

Very welcome!

- Helpful? Like and Accept solution! Support me! Buy me coffee
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Ryviu: Aliexpress Reviews - AliExpress Reviews Importer, one-click import aliexpress reviews, export reviews to CSV file.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

Sajat
Shopify Partner
308 34 43

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.