$arguments = array( "asset" => array( "key" => "templates\/index.liquid", "value" => "<script>alert('foo')</script>", ) ); $updateTheme = $shopify('PUT', '/admin/themes/'.$theme_id.'/assets.json', $arguments);
But it works only for specific pages. In this case index.liquid (https://docs.shopify.com/themes/theme-development/templates/index-liquid) can modify only homepage.
I think that theme.liquid (https://docs.shopify.com/themes/theme-development/layouts/theme-liquid) would do the job but unfortunately it doesn't work.
For my code would be best if he were put in the footer or in header. Is there any way to achieve this?
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.