Dynamic collapsable row

Dynamic collapsable row

robertsolcan
Excursionist
39 0 4

Screenshot 2024-10-17 at 10.32.53.pngI need the final collapsable row to be different for the products that I included in a specific collection, named FINAL SALE%. Do you think you can help me achieve this? Thank you!

Replies 4 (4)

Rohail_Ali_12
Shopify Partner
98 13 14

Hi @robertsolcan,

You can use custom data to create product metafields. This will allow you to display different information under collapsible tabs for each product.

Best regards,

If helpful then please Like and Accept Solution.
Feel free to contact me for your Website Tasks: info@rsdigitals.com
Explore Premium Themes with Editable Creatives: https://www.rsdigitals.com/

rajweb
Shopify Partner
825 71 155

Hey @robertsolcan ,

To create a collapsible row that is different for products in a specific collection named "FINAL SALE%" in your Shopify store,

Follow theme steps:

1. Online Store > Theme > Customize 

2. Open the product template where you want to apply the collapsible row changes.

 

Add Conditional Logic:

1. You will need to use Liquid code to check if the product belongs to the "FINAL SALE%" collection.

2. In the product template file (often found in Section  >  product-template.liquid or similar), locate the collapsible row code.

3. Wrap the collapsible row with a conditional statement to check the product's collection:

{% if product.collections contains 'FINAL SALE%' %}
    <div class="collapsible-row">
        <h3>Drept de Retur 14 zile</h3>
        <p>Puteți returna produsele în termen de 14 zile...</p>
        <!-- Custom content for FINAL SALE% products -->
    </div>
{% else %}
    <div class="collapsible-row">
        <h3>Drept de Retur 14 zile</h3>
        <p>Standard return policy...</p>
        <!-- Default content for other products -->
    </div>
{% endif %}

Customize the Content:

Modify the content inside each collapsible row to reflect what you want to display for the "FINAL SALE%" products versus regular products.

After adding and modifying the code, save your changes.

 

If I was able to help you, please don't forget to Like and mark it as the Solution!

Best Regard,

Rajat Sharma

 

Rajat | Shopify Expert Developer
Need a reliable Shopify developer for your next project?
Our App: Productify Groups App
Email: rajat.shopify@gmail.com
Portfolio: https://rajatweb.dev
robertsolcan
Excursionist
39 0 4

I don't have such a page, only product.json... What should I do?

Dan-From-Ryviu
Shopify Partner
11754 2305 2488

Hi @robertsolcan 

You can try to create a different product template for products of that specific collection 

https://help.shopify.com/en/manual/online-store/themes/theme-structure/templates

- 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.