Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
i'm developing an app.
When the app is installed on a store, it should change an online store template by adding an app block (or section).
For example, add an app block or add a collapsible row to the template.
How can I accomplish this task?
Thanks! jb
Solved! Go to the solution
Thanks so much, @kjchabra . Next: Is it possible for a deep link to duplicate a template or add a new template?
Cheers jb
@den232 apologies for the late reply.
Yes you can duplicate a template via the Admin REST API using the Asset resource. You can call the PUT method if you know which template to duplicate.
Just be careful that if you are planning to build an app for the Shopify store you do need to request access from Shopify.
Starting with Admin API 2023-04, Asset resource PUT or DEL requests are restricted using the write_themes access scope.
If an app that's distributed in the Shopify App Store needs to use Asset resource PUT or DEL requests, then it needs to be
granted an exemption by Shopify to use the write_themes access scope.