Is Possible To Create Shopify Theme Independent Public App?

- 1 answer

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?



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.