[DBUT THEME] Related Product Issue -> Liquid syntax error: Unknown tag 'schema'

Tourist
70 0 3

Hi, 

i've tried to create a new snippet called related-products.

step by step guide over here : 
https://help.shopify.com/themes/customization/products/recommend-related-products

Using the code  given over here:
https://gist.github.com/nicolemackin/e16032afec67c32c82936ac3d080f0bb

The error was -> Liquid syntax error: Unknown tag 'schema'

Could anyone advise what is the root cause to this issue?

Thank you!

 

0 Likes
Highlighted
Astronaut
1925 0 362

There are a few instructions in the GitHub Gist page (under "How you get it").  Try following these steps instead.

How you get it
  1. Create the 'related-products.liquid' as a section file.
  2. In the product template file, add the following section inclusion: {% section 'related-products' %} right beneath the {% section 'product-template' %} line.
0 Likes
Tourist
70 0 3

Hi Alex,

1) do you mean for related-products.liquid, i would have to create a section instead of a snippet?

2) In my product-template.liquid, there is no

{% section 'product-template' %}

0 Likes
Astronaut
1925 0 362

1. Yes, create a new section in the Sections folder and name it "related-products".

2. Open product.liquid in the Templates folder.  You will quickly find {% section 'product-template' %}.

0 Likes
Tourist
70 0 3

Hi Alex,

Thanks alot, work perfectly!

0 Likes
Tourist
181 0 1

Hi There,

I'm using Venture theme I created 'related-products.liquid' as a section file. But I don't see {% section 'product-template' %} in product.liquid.

0 Likes
New Member
9 0 0

Hi everyone

Where do I place the https://gist.githubusercontent.com/nicolemackin/e16032afec67c32c82936ac3d080f0bb/raw/57db02c6f09e796... code in the sections part, which as auto-populated with the below code when I added a new section?

{% schema %}
  {
    "name": "Section name",
    "settings": []
  }
{% endschema %}

{% stylesheet %}
{% endstylesheet %}

{% javascript %}
{% endjavascript %}
 

I can't seem to make it work without causing the same error - I have added a new 'section' as related products. I've tried snippets but that hasn't worked either just in case. Using Debut theme..

 

TYI

0 Likes
Shopify Partner
2522 25 506

Hmm.

Just replace entire file with Gist contents (and replace {% include 'product-card' %} with  {% include 'product-card-grid' %}   for Debut)

Just did that -- works fine.

Want to hire me to tweak a theme? Mail me at tairli@yahoo.com! My post solved your problem? This is my Paypal too :)
0 Likes
New Member
9 0 0

Thanks Tim, I'll do that, but where exactly do I add the Gist contents in the above 'related-products' section coding as shown above. For example, below it all, in between the schema tags or where?

0 Likes
Shopify Partner
2522 25 506

Instead of all pre-exisiting code.  Like click inside the file and Ctrl-A, Ctrl-V (Select All, Paste) :)

Want to hire me to tweak a theme? Mail me at tairli@yahoo.com! My post solved your problem? This is my Paypal too :)
0 Likes