preamble-ajax
v0.0.6
Published
Promise based client for Shopify AJAX API
Downloads
2
Readme
Preamble Ajax
You need to bring your own Promise polyfill.
Usage
getProduct(handle)
Arguments
handle
(String): The handle of the product
Returns
(Object): JSON representation of the product
Example
import { getProduct } from 'preamble-ajax';
getProduct('black-t-shirt');
// → { id: 1, handle: 'black-t-shirt', ... }
addCart(options)
Arguments
options
(Object)
Returns
(Object): JSON representation of the product added
Example
import { addCart } from 'preamble-ajax';
addCart({
id: 1234567,
quantity: 1,
properties: {
'Foo': 'Bar'
}
});