diff options
Diffstat (limited to 'StoneIsland/www/js/lib/products')
| -rw-r--r-- | StoneIsland/www/js/lib/products/ProductView.js | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/StoneIsland/www/js/lib/products/ProductView.js b/StoneIsland/www/js/lib/products/ProductView.js index d1a9005f..69c6e407 100644 --- a/StoneIsland/www/js/lib/products/ProductView.js +++ b/StoneIsland/www/js/lib/products/ProductView.js @@ -190,22 +190,35 @@ var ProductView = ScrollableView.extend({ }.bind(this)) }, + // ADD TO CART save: function(){ - // add to cart + auth.deferred_product = { Size: this.size, Code10: this.code } if ( ! auth.logged_in() ) { - auth.deferred_product = { size: this.size, code: this.code } + app.router.go("account/login") + app.last_view = app.cart } else if ( ! auth.has_cart() ) { - auth.deferred_product = { size: this.size, code: this.code } - auth.create_cart(auth.defer_add_to_cart) + auth.create_cart(auth.add_deferred_product_to_cart) } else { - // ADD TO CART! + auth.add_deferred_product_to_cart() } }, + // BUY NOW cancel: function(){ - // buy now + auth.deferred_product = { Size: this.size, Code10: this.code } + if ( ! auth.logged_in() ) { + app.go("account/login") + app.last_view = app.cart + } + else if ( ! auth.has_cart() ) { + auth.create_cart(auth.add_deferred_product_to_cart) + } + else { + app.go("cart") + auth.add_deferred_product_to_cart() + } }, back: function(){ |
