New Shopify Developer - Need help!

Shopify Partner
3 0 0

Hi, I'm new to Shopify development and have a few questions about a Shopify app that I'm planning on developing. I was hoping that I could get some answers from people with more experience.

On a high level, I'm trying to create a Shopify app (that is not listed in the Shopify store) that will display server generated HTML code for product photos and descriptions and have them inserted into .liquid template files. For example, I want photos on my database to be turned into HTML code that then is inserted under a product listing. The approach I had in mind was to:

  • Automatically inject a code snippet into a user's template file that is just an HTML div with a custom class name (say "test") - or any other approach so that uesr's don't have to manually copy paste code into their files.
  • Have that div named "test" that lives in a file inside the Shopify app and is hidden from the user.
    • "test" makes an AJAX call to a JavaScript function that makes a GET request on my server. The server then sends back HTML as a response. That response is then inserted into the "test" div.
  • So now any time a page is loaded with that template, the page is populated with the server generated HTML.

I was wondering if this sounds like a good approach - and I had some questions about implementation as well. If I could get some help back, I'd be very appreciative.

  1. How do I automatically inject code into .template files so that the user doesn't have to mess with the code?
  2. How do i have a div (i.e. "test") that can live inside the Shopify app, hidden from the user, that gets called by the template (or is there a better way to do that)?

If I could get feedback I would be very appreciative. I'm new to this type of development and want to get started ASAP.