Skip to content

Instantly share code, notes, and snippets.

@travishaynes
Created April 12, 2012 20:37
Show Gist options
  • Save travishaynes/2370815 to your computer and use it in GitHub Desktop.
Save travishaynes/2370815 to your computer and use it in GitHub Desktop.
Using EasyXDM in Shopify to access the cart
window.Shopify = new EasyXDM.Rpc({
remote: "http://domain.myshopify.com/cart"
}, {
remote: {
getCart: {}
}
});
new easyXDM.Rpc({}, {
local: {
getCart: function(callback) {
return $.getJSON("/cart.js", function(cart) {
return callback(cart);
});
}
}
});
Shopify.getCart(function(cart){
console.log(cart);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment