Skip to content
This repository has been archived by the owner on Sep 25, 2018. It is now read-only.

sdn90/preamble-ajax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Preamble Ajax

You need to bring your own Promise polyfill.

Usage

getProduct(handle)

Arguments

  1. 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

  1. options (Object)

Returns

(Object): JSON representation of the product added

Example

import { addCart } from 'preamble-ajax';

addCart({
  id: 1234567,
  quantity: 1,
  properties: {
    'Foo': 'Bar'
  }
});

About

Promise based client for Shopify Ajax API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published