summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/cart
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/cart')
-rw-r--r--StoneIsland/www/js/lib/cart/CartPayment.js9
-rw-r--r--StoneIsland/www/js/lib/cart/CartSummary.js2
2 files changed, 9 insertions, 2 deletions
diff --git a/StoneIsland/www/js/lib/cart/CartPayment.js b/StoneIsland/www/js/lib/cart/CartPayment.js
index 222e2ac9..e65c7e8e 100644
--- a/StoneIsland/www/js/lib/cart/CartPayment.js
+++ b/StoneIsland/www/js/lib/cart/CartPayment.js
@@ -52,6 +52,7 @@ var CartPayment = FormView.extend({
setTimeout(function(){
var state = this.$same_as_shipping.prop("checked")
this.$billing_address_rapper.toggle( ! state )
+ this.address.disabled = state
}.bind(this))
},
@@ -113,7 +114,10 @@ var CartPayment = FormView.extend({
var shipping_info = {}, address_data, address_id, cc_info = {}, cc_data, cc_id
var shipping_type = $("[name=ShippingType]").filter(function(){ return $(this).prop("checked") }).val()
- if (this.address_list_mode) {
+ if (this.$same_as_shipping.prop("checked")) {
+ address_data = app.cart.shipping.data
+ }
+ else if (this.address_list_mode) {
address_id = this.$("[name=AddressId]").filter(function(){ return $(this).prop("checked") }).val()
address_data = app.account.addressLookup[ address_id ]
}
@@ -129,6 +133,9 @@ var CartPayment = FormView.extend({
"guid": cc_data.Guid,
"cvv": this.$("[name=CvvConfirm]"),
}
+
+ console.log("got card on file")
+
app.curtain.show("loading")
promise(sdk.cart.use_stored_credit_card, { data: card_on_file }).then(function(data){
app.curtain.hide("loading")
diff --git a/StoneIsland/www/js/lib/cart/CartSummary.js b/StoneIsland/www/js/lib/cart/CartSummary.js
index 72c44405..cfd34bd7 100644
--- a/StoneIsland/www/js/lib/cart/CartSummary.js
+++ b/StoneIsland/www/js/lib/cart/CartSummary.js
@@ -133,7 +133,7 @@ var CartSummary = ScrollableView.extend({
updateTotals: function(){
var subtotal = this.data.Cart.Totals.TotalWithoutPromotions
var shipping_cost = this.data.Cart.DeliveryMethod.Selected.Amount.Total
- var tax = 0
+ var tax = this.data.Cart.Totals.TotalSalesTax
var total = this.data.Cart.Totals.TotalToPay
this.$subtotal.html( as_cash(subtotal) )