Shopify Object not defined ?

Highlighted
Shopify Partner
13 0 1

Using Slate theme

Trying to implement linked-options and shipping-calculator i get a JavaScript error for the Shopify object 


Uncaught ReferenceError: Shopify is not defined
    at vendor.js?4564460314141664503:43

Uncaught TypeError: Cannot read property 'ShippingCalculator' of undefined


Uncaught TypeError: Shopify.uniq is not a function

Tried console logging the object out from the linked-options.liquid file and i actually do get it in the console
Also calling in from the devtools console outputs it....

What is causing this?

0 Likes
Highlighted
Tourist
8 0 1

Did you try to call Shopify js object after the page loading? In JQuery it will be something like:

 

$(function() {
    console.log(Shopify)
})

 

1 Like
Highlighted
New Member
3 0 0

hi AbdelilahLbardi,

$(function() {
    console.log(Shopify)
})

i tried your solution and i can access my shop. i am new to shopify please can you help me out with accessing Shop Theme Header because i want to show notification in the header using javascript. i am working with ruby on rails BTW. i need urgent help.

your help will be appreciated.

thank you. 

0 Likes
Highlighted
New Member
1 0 0

I'm getting the same issue. Anyone can help with this? 

0 Likes