cartjs
Version:
A simple shopping cart node module
61 lines (53 loc) • 846 B
JavaScript
var fs = require('fs');
var Cartjs = function() {
this._options = {};
}
/**
* init
*
* Initializes the cart system
*/
Cartjs.prototype.init = function(options) {
this._options = options || {};
}
/**
* addProduct
*
* Adds a new product to the cart
*
* return @product
*/
Cartjs.prototype.addProduct = function(product) {
return product;
}
/**
* removeProduct
*
* Removes a product from the cart
*
* return true/false
*/
Cartjs.prototype.removeProduct = function(product) {
return true;
}
/**
* updateProduct
*
* Updates a product in the cart
*
* return @product
*/
Cartjs.prototype.updateProduct = function(product, options) {
return product;
}
/**
* clearCart
*
* Clears the cart.
*
* return true/false
*/
Cartjs.prototype.clearCart = function() {
return true;
}
exports = module.exports = new Cartjs();