Reploverse Icon

Automating State Setup for Dynamic Product Carousel Changes

·
·

Hi, how can I setup States automatically? I want the products in a carrousel to change based on the product shown in the landing page?

  • Avatar of Carissa Cui
    Carissa Cui
    ·
    ·

    Hi Miguel! We have a doc here on how to configure product carousels to automatically scroll to the selected variant: https://support.replo.app/articles/1751373956-how-to-automatically-scroll-a-product-carousel-to-the-selected-variant's-featured-image Is this what you're asking about?

  • Avatar of Miguel Tokumoto
    Miguel Tokumoto
    ·
    ·

    Hi Carissa, yes buit that’s a bit convoluted for me,I have been trying with the replo team on chat but i can’t figure out how to trigger the state changes in content yet

  • Avatar of Carissa Cui
    Carissa Cui
    ·
    ·

    what issues specifically are you running into? would love to help debug this for you. mind sending screenshots or loom recordings?

  • Avatar of Miguel Tokumoto
    Miguel Tokumoto
    ·
    ·

    sure, will DM you

  • Avatar of Steve Schlaefer
    Steve Schlaefer
    ·
    ·

    Miguel Tokumoto do you mind sending the info here? Any reason you can't share it publicly? This is a place were the community comes together to help one another 🙂

  • Avatar of Carissa Cui
    Carissa Cui
    ·
    ·

    got it. can you send me the dashboard link?

  • Avatar of Carissa Cui
    Carissa Cui
    ·
    ·

    yup thats the one! let me take a look

  • Avatar of Carissa Cui
    Carissa Cui
    ·
    ·

    do you want the carousel to only show 3 items when the template product is not one of the selected products in the states?

  • Avatar of Miguel Tokumoto
    Miguel Tokumoto
    ·
    ·

    I’ll explain: Each coffee has 4 variants, for example Molon Labe has 4 variants:

    • Drip

    • Whole Bean

    • French Press

    • Cold Brew

    But also I have 2 product categories, Signature Blends (Molon Labe, Spartan Up, Tough and Strong, Darkest Hour and Seize Your Morning) and Single Origins (Colombia, Ethiopia, Sumatra, Guatemala and Costa Rica). What I want is that, for example, if I am in the Colombia Drip product page, the carrousel shows me the other Single Origin Drips (Sumatra, Guatemala, Costa Rica and Ethiopia). Or if I am at the Darkest Hour Cold Brew product page, carrousel shows me Signature Blends Cold Brews. So the carrousel needs to match the variant and product category in order to show the products.

  • Avatar of Carissa Cui
    Carissa Cui
    ·
    ·

    ahh okay im seeing the issue now. for some reason, the correct states only show in preview mode or on the live page. https://www.loom.com/share/c9c5170365d144288f3df91635996c90?sid=c7f2e4f0-377e-4c8a-9ba7-b180ca6bca76

  • Avatar of Steve Schlaefer
    Steve Schlaefer
    ·
    ·

    Oh the way I would do this is instead of having a different state for every product, you can just have one product container, 1 for each of the products you want, and then use a state to hide the specific product associated with the product you're viewing the page with. Does that make sense?

  • Avatar of Miguel Tokumoto
    Miguel Tokumoto
    ·
    ·

    Hi Steve Schlaefer can you explain this further? I don’t follow

  • Avatar of Miguel Tokumoto
    Miguel Tokumoto
    ·
    ·

    thanks Carissa Cui! I don’t understand the hover state, I see the product changes, do I need to set that up manually too?

  • Avatar of Steve Schlaefer
    Steve Schlaefer
    ·
    ·

    Miguel Tokumoto so let's say you have five products, 1-5. And you have the same Product Template assigned to all of them. So at the top you have a buy box where you're trying to sell the main product (dynamically referred to as the "template product"). And at the bottom you have a section like you do where you'd like to have the other four of the products displayed. So a simplification of the way your page looks is:

    • product buy box for say product 3

    • section showing off products 1, 2, 4, 5

    So the way I'd build the bottom section is actually make one product component for each product, and then have a state on that component that and use that state to hide (with visibility settings) the container if the Template Product = that product. That way that section would always have 1-5 in it, but (as in the example above), if the template product was 3, then the container for 3 would be hidden, leaving only 1,2,4,5. Does that make sense?

  • Avatar of Miguel Tokumoto
    Miguel Tokumoto
    ·
    ·

    thanks Carissa and Steve, I’m gonna test that

  • Avatar of Steve Schlaefer
    Steve Schlaefer
    ·
    ·

    Hi Miguel Tokumoto seems like maybe you're setup is a bit more complex than we originally thought. Do you mind passing me the preview link of the page so we can take a closer look? So this would be either the live site URL or the preview URL (either way it should start with your Shopify store's URL)

  • Avatar of Steve Schlaefer
    Steve Schlaefer
    ·
    ·

    Hi Miguel Tokumoto did you change the setup on this page substantially? I'm not seeing exactly how you tried to configure this with states and it looks like the reason you're seeing the carousel as all white space is because you've completely hidden all of those slides? Maybe I'm just not seeing the configurations you made? Also, looking at your product schema, I want to clarify that you're actually talking about 20 different products. So you have:

    • 2 categories of high level flavors Signature Blends & Single Origins

    • Each category has 5 flavors, so in total 10 -> Molon Labe, Spartan Up, Tough and Strong, Darkest Hour and Seize Your Morning, Colombia, Ethiopia, Sumatra, Guatemala and Costa Rica

    • Each of these 10 flavors has 4 different styles or form factors -> Drip, Whole Bean, French Press, Cold Brew

    Notice how I didn't use the word "Variant" as this means something very specific in Shopify. So this means you have 10*4=40 total products which will be over the limit of 20 for Shopify Pages / Product Template. Not that we can't work around it, just making sure that's understood early. The nice thing here is if you just do 1 Product Template (or Page) for each Category (Sig Blends or Single Origin), you'll be at the 20 product limit! All good! Maybe on each of those pages / PDPs you could have a section that calls out "Try our other category" that links to the other page or something? Ok back to the issue at hand.

    What I want is that, for example, if I am in the Colombia Drip product page, the carrousel shows me the other Single Origin Drips (Sumatra, Guatemala, Costa Rica and Ethiopia). Or if I am at the Darkest Hour Cold Brew product page, carrousel shows me Signature Blends Cold Brews.

    I do think this is possible with states, but it's a bit complex and tedious to setup/test. Here is what I'd do where what I'm gonna describe here is simplification of the Tree Structure I'd put together. - Carousel - Carousel Slides for Drip -> Here I'd have a state that hides this component IF the template product is NOT a one of the 5 Drip products - Slide for Product x5 - Carousel Slides for Whole Bean -> Again state that hides this component IF the template product is NOT a one of the 5 Whole Bean products - Slide for Product x5 - Carousel Slides for French Press -> Again state that hides this component IF the template product is NOT a one of the 5 French Press products - Slide for Product x5 - Carousel Slides for Cold Brew -> Again state that hides this component IF the template product is NOT a one of the 5 Cold Brew products - Slide for Product x5 NOTE here everywhere i have Slide for Product you should use a Product Container that has an "Invisible" state that hides the component IF the template product IS that product. This product component will be repeated several times so I'd make sure you get it completely correct before duplicating it 20 times (or else you're doing a lot of extra work). Once you make 20 of them, 5 for each Slides component, it's just a matter of making sure the configure product on that Product Container is correct AND the "Invisible" state is configured with the right product. So the goal of the states on the Slides level is to hide all the other carousel not relevant to the Coffee Style (Drip, etc). The state config at the individual slide/product component level is just to hide the product that's in the main buy box at the top of the page (the "Template Product"). When I talk about "visibility" I'm talking about this setting Final note. I'd probably start over with this carousel section wrt to implementing the above logic. My assumption is starting from scratch will be easier than undoing the complicated setup you have here. Hope that helps! happy building!

  • Avatar of Miguel Tokumoto
    Miguel Tokumoto
    ·
    ·

    Hi Steve Schlaefer that sound like a great idea. I’ll be checking that, and how to set the visibility setting. I have one question, does this setup makes the page slower?

  • Avatar of Steve Schlaefer
    Steve Schlaefer
    ·
    ·

    Miguel Tokumoto almost certainly yes it is. Really any complicated mechanism (Replo or other) is going to increase JS load and make the page slower. Kinda no real way around it, it's near thermodynamic law of universe stuff. Basically complexity isn't free. That said, it probably won't completely kill your page speed and so it's a tradeoff question. Is the functionality you're looking for worth the speed hit. Another way to reduce complexity here might be to stand up a different Product Template for each Style and Category of coffee. So have 1 PDP for:

    • Sig Blend Drips

    • ....

    • Sig Blend Cold Brew

    • Single Origin Drips

    • ....

    • Single Origin Cold Brew

    (that's a total of 8 PDPs) This would allow you to reduce the complexity on the page and improve page speed.

  • Avatar of Miguel Tokumoto
    Miguel Tokumoto
    ·
    ·

    That sound good. Gonna try it