Skip to content

Instantly share code, notes, and snippets.

@shopifypartners
Created January 28, 2020 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shopifypartners/c67eec5d406a33f1c3dac26b63df3acc to your computer and use it in GitHub Desktop.
Save shopifypartners/c67eec5d406a33f1c3dac26b63df3acc to your computer and use it in GitHub Desktop.
Manage POS line items (with App Bridge)
var lineItemPayload = {
variantId: '1234',
quantity: 1
};
var unsubscriber = cart.subscribe(Cart.Action.UPDATE, function (payload: Cart.Payload) {
console.log('[Client] addLineItem', payload);
unsubscriber();
});
cart.dispatch(Cart.Action.ADD_LINE_ITEM, {
data: lineItemPayload
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment