Shopping Cart module for Springboard
Include this module definition on all pages utilizing the shopping cart. Include the springboardCart.css above your custom styles, and include the springboardCart.js file above your custom scripts. They will not interfere with the existing page's css or scripts(and nothing will happen if you don't initialize it with .shop()
, as seen below). Utilize the SbCart API methods to Initialize, Add, Remove, Checkout, etc., in your custom scripts:
**Arguments in brackets are [optional]*
Dev's option to use the default cart, but you'll have to set and reuse the sessionName on every cart initilization, aka, on every page in which you hope to use the shopping cart. SbCart.shop({
sessionName: 'testSession', //A session name is required
usingDefaultCart: true,
brandName: 'Swan & Son', //I would at least set to blank unless you like my name
txtColor: '#ffffff',
brandLogo: 'https://artic.gospringboard.com/files/artic/swan_crop2.png',
bgColor: '#0A004D',
secondaryColor: '#d8d8d8',
});
SbCart.add('aic_member_plus_161.50','Member Plus', 1, 161.50);
SbCart.remove('aic_member_plus_161.50', 1, function(products){
//do something with products()
});
SbCart.checkout(function(products){
//returns products
//do something with products
});
SbCart.emptyCart();
SbCart.total();
SbCart.products();
SbCart.quantTotal();
The module, on SbCart.checkout()
, will scan these available 'tickets' on the Checkout form, and select all that are in the cart with the proper quantity. The user shouldn't see the available tickets at all, and the module user can display the items in the cart as they see fit, as the product object gets returned to them(Or they can simply keep the defaultCart dropdown open).