skip to Main Content

Liquid/Shopify: how I add jQuery to the page?

I'm having an hard time integrating external jQuery library into my own liquid page. I'd like to load it with the CDN. On the theme.liquid page I load the Javascript this way: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> {{ 'spot-the-ball.js' | asset_url | script_tag…

VIEW QUESTION

Shopify how to create Price Rule through API

I am new to shopify. Now I want to use shopify API to create a price rule, this is my source code here I use rails 5.1.4, shopify_app 8.1.0 shop_url = "https://api_key:secret@domain/admin" ShopifyAPI::Base.site = shop_url prerequisite_saved_search_ids = [53677883419] price_rule =…

VIEW QUESTION

Simple Javascript Execution – Shopify

this should be fairly simple for those of you who understand jQuery. I am trying to get this script to run ONLY if <span class="site-header__cart-indicator "></span> is present on the loaded page. Here is the untouched jQuery code: window.setTimeout(redirectCheckout, 2000);…

VIEW QUESTION

Shopify API Cross Domain Ajax Request

I am using the below code to get the customer details from shopify. I have redirected my domain to the other domain from the shopify admin. function setEmailWithLoggedInUser(callback) { $.ajax({ url: 'https://new-website-shopify.myshopify.com/admin/customers/'+__st.cid+'.json', crossDomain: true, beforeSend: function(xhr) { xhr.setRequestHeader("Authorization", "Basic XXXXXXXXXXXX")…

VIEW QUESTION
Back To Top
Search