0
votes

I'm working on Shopify public app development. As the part of my app functionality, I have to put some liquid code in some of the front files like

i) sections/cart-template.liquid ii) sections/product-template.liquid etc.

I have automated the code putting process through the code in the default template[Debut].

Can I implement these in all themes?

I have checked the others themes and found that template structure of each theme is different. Is any possible method available to make these template changes automated in all themes?

2

2 Answers

2
votes

Unfortunately no, because each theme might be very different. Some themes might even have different filenames for this sections or they might have completely different HTML structure.

There is no easy and universal way how to solve this problem. One of the ways:

  • You can do some heuristic in the theme files and try to find a correct place where to insert your code. For example, langify is doing that. It's scanning the whole theme and finding places where to insert their code.
  • You can ask a customer to add your code manually. Many apps are doing that because it will cause fewer errors. You just need to prepare detailed manual how to set it up properly.
0
votes

Each theme having their own structure,it is difficult to place the exact code.

Victor Leontyev was correct.Langify scanning the whole theme and replace the code with the required place.You should analyze the code and fix the desired location to place.After that, you can insert the code programmatically.

You can mention, in which place code need to be inserted in the user manual. Based on the theme you can insert the code manually with the help of user manual.

For your Reference, added one Shopify app URL. In that app, they are given instructions to the client via user manual.Check the user manual after installing Fast Order app.

https://apps.shopify.com/fast-order

Hope it will help.