Im developing a Shopify public app using Ruby on Rails. I want disaply some information in all the store front pages. The official documents only explains about the admin panel modifications. How can I access the store front? And where I should add the scripts, I mean in which controller?
Actually Im a PHP Developer. Im new to Shopify and also Ruby on Rails. Im trying to develop a shopify public app which will show product related information in all pages (front-end). I followed shopify’s tutorial first, and created a hello world like app which displays products list in admin side. But I really cant find anything that make changes in the store frontend.
So please help me that how to make changes in frontend. Also I want to get the current user information and product details (if it is a product view page).
3
Answers
We can use config.scripttags to load javascripts in shopify store front pages. The syntax will be as follows:
You should add this code in the shopify_app Gem initializer file, which can be found in
Hope this will help someone..!
It sounds like you’re asking where you need to place your JS files to have them load up on the Front End. This should help:
http://railsapps.github.io/rails-javascript-include-external.html#locations
You can refer this from shopify which provides you admin APIs for add new page , update page , get customer, get products etc.. like that
Shopify Admin APIs
there is section for online store which contains the pages API also you can see API for products , orders and customers.
you can also add your js file in online store pages with https endpoint statically in admin account of shopify
example code
add your js code like this in online store page and check that your js is loading there or not