How to render a snippet on the homepage section?

Solved
Highlighted
Excursionist
18 1 2

Hi,

I'm trying to render a snippet on the homepage featured-product section, or in the homepage in general. I've managed to render this snippet on the product page (for hiding the unavailable variants). But I have a featured product on the homepage, which also needs this. Can someone show me how to render this snippet properly so it will apply to the featured product on the homepage? Thanks!

This is my homepage: https://earlorange.com/

This is what I did on the Theme.liquid to render the snippet on the product page, it works well. 

Screenshot 2020-07-28 at 15.46.55.png

I want to render the 'Hide-variants' on the featured-product on my homepage, so the unavailable won't appear. 

Screenshot 2020-07-28 at 15.59.42.png

0 Likes
Highlighted
Excursionist
18 1 2

Does anyone have experience with this or anything similar? If you can share some thought that'd be great.  Thanks in advance!

0 Likes
Highlighted
Astronaut
1085 177 213

Use {% include 'hide-variants' %}

I'd recommend making it lowercase as well. Instead of Hide rename it to hide.

Kind regards,
Diego

◦ Problem Solved? ✔️ Please click on Accept as Solution and like.
◦ Hire me! Recommended by 25+ customers on Facebook. Click here to read their reviews.
◦ Contact me at: diego.boarutto.fortes@gmail.com
0 Likes
Highlighted
Excursionist
18 1 2

Hi Dantepw,

Thank you for the suggestion. I really appreciate it!

I tried the changes but it doesn't work Any clue where to double check?

Thanks,

Siemon

0 Likes
Highlighted
Astronaut
1085 177 213

This is an accepted solution.

Hello,

1. Create a new snippet in the "snippets" folder called "test-me"
2. Add some simple code just to make sure it renders, something like <p>hello from snippet</p>
3. Render it with {% include 'test-me' %}

If that shows up it means the snippet is being rendered properly. From there proceed to develop your own code.


Let me know whether it works.

 

◦ Problem Solved? ✔️ Please click on Accept as Solution and like.
◦ Hire me! Recommended by 25+ customers on Facebook. Click here to read their reviews.
◦ Contact me at: diego.boarutto.fortes@gmail.com
0 Likes
Highlighted
Excursionist
18 1 2

It works, thanks for the advice 

0 Likes