Can multiple buy buttons be stored in one JavaScript file?

Can multiple buy buttons be stored in one JavaScript file?

Jonathan_ezApps
Shopify Partner
24 0 6

Hi all,

 

I am currently writing some blogs on my shopify website, and I have been including buy buttons, but the number of them are growing drastically as I am using the blog as a way to showcase different products. I fear that the blog will load slowly as I am nearing 20+ buy buttons. 

 

Is it possible to have all these buy button scripts in a separate JavaScript file that I can keep in my Assets folder, and then simply link to them? Something like <script src="path/to/assets/">? Can I have multiple buy buttons in this one file, or do they all need there own individual .js files.

 

Thanks!

Print and save invoices directly from your order page: https://apps.shopify.com/ezinvoices
Reply 1 (1)

Litos
Globetrotter
688 169 150

Hi @Jonathan_ezApps,

Are you trying to load buy buttons with ajax?

Please send your site and if your site is password protected, please send me the password. I will check it.

Litos - Shopify Development Service Provider
Need to develop or customize your Shopify store, feel free to contact us here.