How to render a snippet on the homepage section?

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.

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

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

Use {% include ‘hide-variants’ %}

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

Kind regards,
Diego

Hi Dantepw,

Thank you for the suggestion. I really appreciate it!

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

Thanks,

Siemon

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

    hello from snippet

  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.

It works, thanks for the advice