Home Javascript SDK Rest API/SSO AppMarket Login

Javascipt SDK

Global PUBSUB events

to use JS currect on your site. you must use pubsub.

ccpubsub.ready event

fired when all relevant scripts are loaded.
ccpubsub.subscribe("ready", function(){ // .. your code here })

ccpubsub.pageview event

fired when user view a page
ccpubsub.subscribe("pageview", function(){ // .. your code here })

ccpubsub.cart_add event

fired when user add an item to the shopping cart.
recieved parameters: pid - product id, qty, price
ccpubsub.subscribe("cart_add", function(pid,qty,price){ // .. your code here })

ccpubsub.cart_remove event

fired when user clicks on add to cart button.
recieved parameters: pid - product id
ccpubsub.subscribe("cart_remove", function(pid){ // .. your code here })

ccpubsub.cart_updated event

fired when cart is changed.
recieved parameters: {data}
ccpubsub.subscribe("cart_updated", function(pid){ // .. your code here })

ccpubsub.paybutton_click event

fired when user clicks on add to cart button.
recieved parameters: cart object
ccpubsub.subscribe("paybutton_click", function(cart){ // .. your code here })

Checkout PUBSUB events

ccpubsub.checkout_ready event

fired when checkout page is loaded.
recieved parameters: cart object
ccpubsub.subscribe("checkout_ready", function(cart){ // .. your code here })

ccpubsub.cart_calculate_price event

fired when user change settings on checkout page (like: shipping, payment method..).
recieved parameters: cart object
ccpubsub.subscribe("cart_calculate_price", function(cart){ // .. your code here })