Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hi, I am trying to set up a theme app extension,
I created an extension and published it with the snippet.
Now I want to apply this snippet to the store's main theme. But I don't understand how to do it.
Snippet should be added to theme.liquid file.
I can change theme assets with API to include my code, but I don't understand how to do it with app extensions.
I read this doc, but its unclear https://shopify.dev/docs/apps/online-store/theme-app-extensions/update
I need exactly this, but it's unclear how to do it with the app extension
For example, apps often require the following to integrate with online stores:
Adding snippets to the
snippets
directory of a published theme, which are then added to a page by modifying Liquid layout, template, or section files.
How to apply code block or snippet to the theme.
Solved! Go to the solution
This is an accepted solution.
OK I found the answer, I need to create block with "target": "body",
This is an accepted solution.
OK I found the answer, I need to create block with "target": "body",
Hey, I wanted to follow up on your recent response regarding the code issue. While I appreciate your input, it would be immensely helpful if you could provide a more detailed explanation of your solution. Could you please expand on the steps and thought process behind your answer, including any relevant code snippets or considerations? This would greatly enhance my understanding and benefit others who may encounter a similar problem.
You need to create a block as described in documentation
for example
your-block.liquid