Altering a product page through custom shopify app

Highlighted
New Member
1 0 0

Hi there,

 

I'm in the process of developing my first Shopify application and am having trouble finding a way to reflect the app's configuration on the Shopify store dynamically. Is there any references that can assist me with this?

 

A random example:

1. Customer in Shopify dashboard selects they want the app to put a big red button on the home page

2. App extracts the data from the configuration

3. App places big red button on home page automatically

 

How do I dynamically inject this code into the theme's liquid as described?

 

Thanks,

K

0 Likes
Highlighted
Shopify Partner
1226 5 81

Hi Kane,

 

App extracts the data from the configuration

There are a few ways of doing this:

 

  • via an app proxy to reach into your server to grab the configuration, typically in conjunction with a script tag loaded JS file
  • using metafields and grabbing it via liquid
  • writing a file to the themes assets so you can access it via settings in liquid

Each has pros and cons so I'd recommend searching around this forum a bit to read up on it.

 

How do I dynamically inject this code into the theme's liquid as described?

Shopify's recommendation is to use a script tags. The problem is they load after everything else, which is Ok on a site that has been optimized with small images and such but they can be slow for some sites, especially if there are a lot of apps installed.

 

HTH, Gavin. 

 

 

www.bookthatapp.com
0 Likes