summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--StoneIsland/www/js/lib/account/AccountView.js2
-rw-r--r--StoneIsland/www/js/lib/auth/LoginView.js5
-rw-r--r--StoneIsland/www/js/lib/auth/SignupView.js5
-rw-r--r--StoneIsland/www/js/lib/cart/CartSummary.js6
-rw-r--r--StoneIsland/www/js/lib/products/ProductView.js24
-rw-r--r--StoneIsland/www/js/sdk/cart.js2
6 files changed, 29 insertions, 15 deletions
diff --git a/StoneIsland/www/js/lib/account/AccountView.js b/StoneIsland/www/js/lib/account/AccountView.js
index e9022d64..cbd9a9c6 100644
--- a/StoneIsland/www/js/lib/account/AccountView.js
+++ b/StoneIsland/www/js/lib/account/AccountView.js
@@ -52,7 +52,7 @@ var AccountView = View.extend({
}
else {
if (auth.deferred_product) {
- auth.add_deferred_product_to_cart( app.cart.load.bind(app.cart) )
+ auth.add_deferred_product_to_cart()
}
else {
app.cart.load()
diff --git a/StoneIsland/www/js/lib/auth/LoginView.js b/StoneIsland/www/js/lib/auth/LoginView.js
index b761b5e8..1f7438cc 100644
--- a/StoneIsland/www/js/lib/auth/LoginView.js
+++ b/StoneIsland/www/js/lib/auth/LoginView.js
@@ -16,10 +16,11 @@ var LoginView = FormView.extend({
},
show: function(){
- var msg = "* Your personal and payment<br>information will always remain private"
if (auth.logged_in()) {
- msg += "<br><br>You are already logged in."
+ app.router.go("intro")
+ return
}
+ var msg = "* Your personal and payment<br>information will always remain private"
app.footer.show("SUBMIT", "CANCEL")
this.$form.get(0).reset()
this.$msg.html(msg)
diff --git a/StoneIsland/www/js/lib/auth/SignupView.js b/StoneIsland/www/js/lib/auth/SignupView.js
index fe0e28db..5d947d41 100644
--- a/StoneIsland/www/js/lib/auth/SignupView.js
+++ b/StoneIsland/www/js/lib/auth/SignupView.js
@@ -29,10 +29,11 @@ var SignupView = FormView.extend({
},
show: function(){
- var msg = "* Your personal and payment<br>information will always remain private"
if (auth.logged_in()) {
- msg += "<br><br>You are already logged in."
+ app.router.go("intro")
+ return
}
+ var msg = "* Your personal and payment<br>information will always remain private"
app.footer.show("SUBMIT", "CANCEL")
this.$form.get(0).reset()
this.$msg.html(msg)
diff --git a/StoneIsland/www/js/lib/cart/CartSummary.js b/StoneIsland/www/js/lib/cart/CartSummary.js
index ce7ae650..7a5a1cfe 100644
--- a/StoneIsland/www/js/lib/cart/CartSummary.js
+++ b/StoneIsland/www/js/lib/cart/CartSummary.js
@@ -37,6 +37,7 @@ var CartSummary = ScrollableView.extend({
load: function(){
this.$loader.show()
+ app.footer.show("SHIPPING &gt;", "CANCEL")
sdk.cart.get_status({
success: this.populate.bind(this),
error: this.empty.bind(this),
@@ -45,9 +46,10 @@ var CartSummary = ScrollableView.extend({
populate: function(data){
this.data = data
-console.log(data)
+
+ console.log("CART", data)
+
this.$loader.hide()
- app.footer.show("SHIPPING &gt;", "CANCEL")
this.update_counts()
diff --git a/StoneIsland/www/js/lib/products/ProductView.js b/StoneIsland/www/js/lib/products/ProductView.js
index cf6c1a90..c99ff0ab 100644
--- a/StoneIsland/www/js/lib/products/ProductView.js
+++ b/StoneIsland/www/js/lib/products/ProductView.js
@@ -211,11 +211,16 @@ var ProductView = ScrollableView.extend({
app.last_view = app.cart
}
else if ( ! auth.has_cart() ) {
- auth.create_cart(auth.add_deferred_product_to_cart)
+ auth.create_cart(function(){
+ auth.add_deferred_product_to_cart(function(){
+ app.router.go("cart")
+ })
+ })
}
else {
- app.go("cart")
- auth.add_deferred_product_to_cart()
+ auth.add_deferred_product_to_cart(function(){
+ app.router.go("cart")
+ })
}
},
@@ -223,15 +228,20 @@ var ProductView = ScrollableView.extend({
cancel: function(){
auth.deferred_product = { Size: this.size, Code10: this.code }
if ( ! auth.logged_in() ) {
- app.go("account/login")
+ app.router.go("account/login")
app.last_view = app.cart
}
else if ( ! auth.has_cart() ) {
- auth.create_cart(auth.add_deferred_product_to_cart)
+ auth.create_cart(function(){
+ auth.add_deferred_product_to_cart(function(){
+ app.router.go("cart")
+ })
+ })
}
else {
- app.go("cart")
- auth.add_deferred_product_to_cart()
+ auth.add_deferred_product_to_cart(function(){
+ app.router.go("cart")
+ })
}
},
diff --git a/StoneIsland/www/js/sdk/cart.js b/StoneIsland/www/js/sdk/cart.js
index 3f53d9d5..bbd03299 100644
--- a/StoneIsland/www/js/sdk/cart.js
+++ b/StoneIsland/www/js/sdk/cart.js
@@ -83,7 +83,7 @@ sdk.cart = (function(){
cart.get_status = function(opt){
if (! cart.id) {
- return opt.error()
+ return opt.error({ error: "no cart" })
}
return $.ajax({
method: "GET",