diff options
Diffstat (limited to 'StoneIsland/www/js/lib/cart/CartSummary.js')
| -rw-r--r-- | StoneIsland/www/js/lib/cart/CartSummary.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/StoneIsland/www/js/lib/cart/CartSummary.js b/StoneIsland/www/js/lib/cart/CartSummary.js index 209e3102..05842380 100644 --- a/StoneIsland/www/js/lib/cart/CartSummary.js +++ b/StoneIsland/www/js/lib/cart/CartSummary.js @@ -110,21 +110,21 @@ var CartSummary = ScrollableView.extend({ .replace(/{{price}}/, as_cash(details.Item.Price.DiscountedPrice)) $el.data("price", details.Item.Price.DiscountedPrice) $el.html(t) - this.deferScrollToTop() + this.refreshScroller() }.bind(this)) }.bind(this)) this.updateTotals() this.el.className = "full" - this.deferScrollToTop() + this.refreshScroller() }, updateCounts: function(){ - app.header.set_cart_count(this.data.Cart.Items.length) - this.parent.$itemcount.html(pluralize(this.data.Cart.Items.length, "ITEM", "S")) + app.header.set_cart_count( this.data.Cart.Items.length ) + this.parent.setHeaderCount( this.data.Cart.Items.length ) }, - + updateTotals: function(){ var subtotal = this.data.Cart.Totals.TotalWithoutPromotions var shipping_cost = this.data.Cart.DeliveryMethod.Selected.Amount.Total @@ -140,6 +140,7 @@ var CartSummary = ScrollableView.extend({ empty: function(){ app.footer.hide() app.header.set_cart_count(0) + this.parent.setHeaderCount( 0 ) this.parent.$itemcount.html("0 ITEMS") this.el.className = "empty" }, @@ -155,9 +156,9 @@ var CartSummary = ScrollableView.extend({ remove_item: function(e){ var $el = $( e.currentTarget ).closest(".cart_item_row") var data = $el.data() - data.Cart.Totals.TotalWithoutPromotions -= data.price - data.Cart.Totals.TotalToPay -= data.price - + + this.data.Cart.Totals.TotalWithoutPromotions -= data.price + this.data.Cart.Totals.TotalToPay -= data.price this.data.Cart.Items = this.data.Cart.Items.filter(function(item){ return ( item['Code10'] !== data.code || item['Size'] !== data.size) }) @@ -165,6 +166,7 @@ var CartSummary = ScrollableView.extend({ this.updateTotals() this.updateCounts() $el.remove() + this.refreshScroller() if (this.data.Cart.Items.length == 0) { this.empty() |
