Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to develop a Bigcommerce app that would add a javascript tag to all pages in the store?

I would like to develop an app for Bigcommerce that other users of the platform could use. The app should add a simple javascript embed code to all pages of the store. The embed code is similar in nature to google analytics embed or chat services embed codes.

I have opened up a trial account with Bigcommerce and found out that it is very easy to manually edit the page templates to add such an embed code, but I would like to be able to develop an app that store owners could install and not have to mess with editing and copy-pasting embed codes into their page templates.

like image 789
odedbd Avatar asked Jan 16 '14 15:01

odedbd


People also ask

When you use the NPM command line utility to add a JavaScript component to your theme stencil will not automatically bundle and minify the component?

When you use the npm command-line utility to add a JavaScript component to your theme, Stencil will automatically bundle and minify the component. To enable this bundling and minification, run each module's npm install command from the root directory of your theme.

What is stencil BigCommerce?

Stencil is BigCommerce's theme engine. It incorporates industry best practices in technology, design standards, SEO, and allows developers to build a stunning storefront that engages shoppers and encourages checkouts on any device. Stencil themes are supported on the following browsers.


1 Answers

Unfortunately there is no mechanism currently for BigCommerce that allows for the editing of template code via the app.

I can give you pointers as to where you can put your code to make it globally available.

  • If you need something in the <head> globally: /Panels/HTMLHead.html
  • If you need something at the beginning, right after the <body>: /Panel/DrawerMenu.html
  • If you need something at the end, right before the </body>: /Panels/Footer.html

These are the 3 common places most javascript things (like tracking pixels and analytics) usually go.

Other "extensions" for BigCommerce, such as OLark and Zendesk and Analytics, all just give either a web page with instructions, or a PDF with installation instructions. You could provide your functionality via the same means in lieu of an app doing it.

like image 136
JPMC Avatar answered Sep 18 '22 20:09

JPMC