[IMPORTANT] Create a custom template necessary for the correct functioning of the application
Instruction for a merchant to add a custom template
required for the correct functioning of the application:
Go to the theme template editing section:
In the left menu, select Sales Channels → Online Store.
On the
Themes
page, click the button with three dots and select theEdit Code
item.
Click
Add new template
in the left list under the Templates group heading.In the
Template
type dropdown, select the valueproduct
, thenliquid
. Addsub-json
to the filename field.
Insert the following content in the editor:
{% layout none %}{% capture output %}
{
"id":{{product.id}},
"handle":"{{product.handle}}",
"key":"{{product.key}}",
"title":{{product.title | json}},
"images":[{{product.images[0].src | json}}],
"variants":[{% for variant in product.variants %}{"id":{{variant.id}},"title":{{variant.title | json}},"inventory_quantity":{{variant.inventory_quantity}},"available":{{variant.available}},"price":{{variant.price}}}{% unless forloop.last %},{% endunless %}{% endfor %}]
}{% endcapture %}{{ output | strip_newlines }}
Click
Save
button.