Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Altering a product page through custom shopify app

Altering a product page through custom shopify app

KaneT36
Shopify Partner
4 0 1

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

Reply 1 (1)

Gavinator
Shopify Partner
1318 15 124

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