diff options
Diffstat (limited to 'StoneIsland/www/js/lib/products/ProductView.js')
| -rw-r--r-- | StoneIsland/www/js/lib/products/ProductView.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/StoneIsland/www/js/lib/products/ProductView.js b/StoneIsland/www/js/lib/products/ProductView.js index e21c28f1..5fe1fe7b 100644 --- a/StoneIsland/www/js/lib/products/ProductView.js +++ b/StoneIsland/www/js/lib/products/ProductView.js @@ -185,13 +185,22 @@ var ProductView = ScrollableView.extend({ return this.colors[key] }.bind(this)) app.selector.select(colors, function(color){ - this.color = color.value + this.code = color.code this.$color.html(color.label) }.bind(this)) }, save: function(){ // add to cart + if ( ! auth.logged_in() ) { + auth.defer_add_to_cart = { size: this.size, code: this.code } + } + else if ( ! auth.has_cart() ) { + auth.deferred_product = { size: this.size, code: this.code } + auth.create_cart(auth.defer_add_to_cart) + } + else { + } }, cancel: function(){ |
