Hide collapsible tab when metafields are empty in Momentum theme

Hide collapsible tab when metafields are empty in Momentum theme

MikeCZ
Shopify Partner
3 0 0

Im trying to hide the collasible tabs when emtpy. Im using the following metafields 
{{ product.metafields.custom.shipping.value.tab_content }}

This is an example of a product with a metafield assign to it.
https://9livesracing.com/products/128i-big-wang-kit-07-13-e82?_pos=1&_psq=128i+Big+Wang+Kit+%2707-13...

 

This is an example of a product with a no metafield assign to it.
https://9livesracing.com/products/add-on-swan-it-change-any-wang-kit-to-swan-mounting

Thank you

 

Replies 4 (4)

BSSCommerce-TC
Shopify Partner
225 49 51

Hi @MikeCZ ,

You need a custom code to do that and we can help you

 

If our suggestions are useful, please let us know by giving it a like, marking it as a solution.


MIDA: Heatmap, Record & Replay |BLOOP Referral Program, Reward |

Need help from our expert? Kindly share your request with us via community@bsscommerce.com


BSS Commerce - Full-service eCommerce Agency
MikeCZ
Shopify Partner
3 0 0

Thanks @BSSCommerce-TC, can you share the solution by replying to this comment?   

BSSCommerce-TC
Shopify Partner
225 49 51

Hi @MikeCZ ,

Let try insert below code at the end file theme.css and Save theme

div[data-name="custom-liquid"]:not(.pb-l.md\:pb-xl > p) {
    display: none !important;
}

If our suggestions are useful, please let us know by giving it a like, marking it as a solution.


MIDA: Heatmap, Record & Replay |BLOOP Referral Program, Reward |

Need help from our expert? Kindly share your request with us via community@bsscommerce.com


BSS Commerce - Full-service eCommerce Agency
MikeCZ
Shopify Partner
3 0 0

Thank you for your response. Unfortunately, the code hides the shipping tab regardless of whether the tab is empty or populated with a metafield.