I have a Shopify app and would like to add it to Shopify as dynamic section programmatically. I know how to do it manually.
Basically i create .liquid file in sections in theme code editor.
Here is short tutorial for adding dynamic sections: https://www.shopify.com/partners/blog/how-to-create-your-first-shopify-theme-section
But i would like to achieve the same result programmatically, i.e via some API call.
Is it possible at all?
2
Answers
Liquid is a server side rendering language, this means you can not re-render on realtime. but you could render your code and hide it with display: none; and using axios or ajax after calling your API show that section.
Yes it is possible, but the related API is in preview mode still and is not advised to be used in production environments.
That being said, have a look at Section Theme Rest API. Specifically, you will need to work with Sections Property.