New Shopify Developer - Need help!!!!

Highlighted
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.

0 Likes
Highlighted
Shopify Expert
9973 110 1782

How do I automatically inject code into .template files so that the user doesn't have to mess with the code?

Not a good idea. How will you know where in the design/layout this should be added? How would you know what theme to add it to? You can't assume the merchant wants it added to the live theme, and you can't assume to know the location they want it at.

 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Highlighted
Shopify Partner
3 0 0

Let's say that I wanted to embedd code underneath the product title which from my understanding is a consistent part of the vast majority of stores? Do you know how I would do it?

 

 

0 Likes
Highlighted
Pathfinder
108 12 33

Hi @uri_rahimi were you able to do this?

0 Likes