-
-
function FluidbookCartPuma(cart) {
var $this = this;
this.cart = cart;
this.save();
return this.fluidbook.l10n.__("the item has been added to your cart");
} else {
- this.removeFromCart(ref);
+ this.removeFromCartByRef(ref);
return this.fluidbook.l10n.__("the item has been removed from your cart");
}
},
- removeFromCart: function (ref) {
+ removeFromCartByRef: function (ref) {
var key = this.items.indexOf(ref);
+ if (key >= 0) {
+ this.removeFromCart(key)
+ }
+ },
+
+ removeFromCart: function (key) {
+ console.log(key);
if (key >= 0) {
this.items.splice(key, 1);
this.save();