ngCart
ngCart copied to clipboard
setQuantity() doesn't return the quantity as it written in documentation
So I fix it so :
item.prototype. = function(quantity, relative){
var quantityInt = parseInt(quantity);
if (quantityInt % 1 === 0){
if (relative === true){
this._quantity += quantityInt;
return this._quantity; // fix
} else {
this._quantity = quantityInt;
return this._quantity; // fix
}
if (this._quantity < 1) this._quantity = 1;
} else {
this._quantity = 1;
$log.info('Quantity must be an integer and was defaulted to 1');
}