Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello.
Kindly forgive me for a basic question, but I have a question about {% form 'product' %}.
In order to make the "buy button" dynamic on the product detail page (corresponding template: product.json, template-product.liquid)
I inserted the following code,
{% form 'product' product %} <input type="submit" class="flex w-full items-center justify-center rounded-md border border-transparent bg-indigo-600 py-3 px-8 text-base font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:ring-offset-gray-50" value="購入する" > {% endform %}
In spite of loading template-product, as in the following page,
https://tailwind-ui.myshopify.com/products/leatherbound-daily-journal
(you can see the page link above with password of awstaw)
I've got the Liquid error (sections/template-product line 181): new_comment form must be given an article. I guess that this error is displayed in article template, but the error is shown in product template. I don't know why, and {% form 'product' product %} is not working at all, only showing the error : new_comment form must be given an article.
Have anybody encounter such a strange error, and know how to fix it ?
The below is the URL of the github repository that contains the code of the above theme as it is.
https://github.com/nirdoshyaqin/shopify_tailwind
Thanks in advance,
Solved! Go to the solution
This is an accepted solution.
Hi @nirdoshyaqin,
You have missed a comma. The correct syntax is:
{% form 'product', product %}
This is an accepted solution.
Hi @nirdoshyaqin,
You have missed a comma. The correct syntax is:
{% form 'product', product %}
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025