Different before and after slide for each product page

Different before and after slide for each product page

lenssis2025
Tourist
4 0 1

Hi, I found a few apps that have before-and-after slide, however it applies to all product pages.

I want to make separate before-and-after slide for each product page. 

How can I do that? 

Replies 2 (2)

Dan-From-Ryviu
Shopify Partner
11363 2228 2400

Hi @lenssis2025 

Please check if the app can apply slides to selected products. If it does not, I guess you will need to create a separate product template for each product and then add a separate slide to them. 

You can check this to learn how to create a separate product template.

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

 

Best regards,

Dan

- Found this helpful? Hit "Like" and "Accept as Solution"! Support me: Donate!
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
Built for Shopify

Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

oscprofessional
Shopify Partner
16344 2438 3180

Hi @lenssis2025 ,

To create a before-and-after slider specific to each product page in Shopify:

Using Metafields 

  1. Add Metafields

    • Go to Settings > Custom Data > Products
    • Create two metafields: before_image & after_image (File type).
    • Upload images per product.
  2. Edit Theme Code

    • Open product.liquid and add:

 

{% if product.metafields.custom.before_image and product.metafields.custom.after_image %}
  <div class="before-after-slider">
    <div class="before" style="background-image: url('{{ product.metafields.custom.before_image | img_url: 'large' }}');"></div>
    <div class="after" style="background-image: url('{{ product.metafields.custom.after_image | img_url: 'large' }}');"></div>
    <input type="range" min="0" max="100" value="50" class="slider">
  </div>
  <script>
    document.querySelector(".slider").addEventListener("input", function () {
      document.querySelector(".after").style.clipPath = `inset(0 ${100 - this.value}% 0 0)`;
    });
  </script>
{% endif %}

 

     3.Save & Check – Each product will display its own unique before-and-after slider.

Hire us | Pass Core Web Vital | B2B Wholesale Experts | Claim Your Free Website Review |
Connect with Us: WhatsApp | Skype: oscprofessionals-87 | Email: pallavi@oscprofessionals.com |
Custom Shopify SolutionsPrivate Apps, Theme Customization & SEO | Digital Marketing |
OSCP Apps: Discount Suite | Wholesale App | Bundle & Upsell | Shipping Discount | and more...