diff options
Diffstat (limited to 'StoneIsland/www/js/lib/cart/CartSummary.js')
| -rw-r--r-- | StoneIsland/www/js/lib/cart/CartSummary.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/StoneIsland/www/js/lib/cart/CartSummary.js b/StoneIsland/www/js/lib/cart/CartSummary.js index 77c40b52..d4729182 100644 --- a/StoneIsland/www/js/lib/cart/CartSummary.js +++ b/StoneIsland/www/js/lib/cart/CartSummary.js @@ -15,6 +15,12 @@ var CartSummary = ScrollableView.extend({ this.$cart_body = this.$(".cart_body") this.$cart_empty = this.$(".cart_empty") this.scroller = new IScroll('#cart_summary', app.iscroll_options) + + this.$rows = this.$(".rows") + this.$subtotal = this.$(".subtotal") + this.$shipping = this.$(".shipping") + this.$tax = this.$(".tax") + this.$total = this.$(".total") }, show: function(){ @@ -45,9 +51,21 @@ var CartSummary = ScrollableView.extend({ console.log(data) app.header.set_cart_count(data.Cart.Items.length) - console.log("HEY") + this.parent.$itemcount.html(pluralize(data.Cart.Items.length, "ITEM", "S")) + this.$rows = this.$(".rows") + + var subtotal = data.Cart.Totals.TotalToPay + var shipping_cost = data.Cart.DeliveryMethod.Selected.Amount.Total + var tax = 0 + var total = data.Cart.Totals.TotalToPay + + this.$subtotal.html( as_cash(subtotal) ) + this.$shipping.html( as_cash(shipping_cost) ) + this.$tax.html( as_cash(tax) ) + this.$total.html( as_cash(total) ) + this.$el.removeClass("empty").addClass("full") this.deferScrollToTop() }, |
