ngCart icon indicating copy to clipboard operation
ngCart copied to clipboard

setQuantity() doesn't return the quantity as it written in documentation

Open morwin10 opened this issue 9 years ago • 0 comments

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');
            }

morwin10 avatar Feb 16 '16 16:02 morwin10