Skip to content

Instantly share code, notes, and snippets.

@bakura10
Created December 14, 2016 15:07
Show Gist options
  • Save bakura10/afa21c88d05c25c36d67ffb85630b836 to your computer and use it in GitHub Desktop.
Save bakura10/afa21c88d05c25c36d67ffb85630b836 to your computer and use it in GitHub Desktop.
Pipeline events:
* add_product.pre
* add_product.post
Theme could add messages to the pipeline:
ShopifyApi.Pipeline.addProduct(1234, 1).then(function(pipelineStatus, cart) {
// do things
});
Apps could hook to events:
var priority = 2;
ShopifyApi.Pipeline.listen('add_product.pre', priority, function(requestedId, requestedQuantity) {
// An app could implement its own logic to prevent the element to be added, for instance
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment