diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-25 06:27:28 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-25 06:27:28 -0500 |
| commit | c0eff609a1d882c9246a4c38627b7c343faf92cb (patch) | |
| tree | 4408c1bff2a5fa57fb2b107234381d180ee44419 /StoneIsland/www/js | |
| parent | 40e27113f79d2bcf6d5918d87e836e7981577004 (diff) | |
handle onesize products
Diffstat (limited to 'StoneIsland/www/js')
| -rw-r--r-- | StoneIsland/www/js/lib/products/ProductView.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/StoneIsland/www/js/lib/products/ProductView.js b/StoneIsland/www/js/lib/products/ProductView.js index bd28955f..e151c208 100644 --- a/StoneIsland/www/js/lib/products/ProductView.js +++ b/StoneIsland/www/js/lib/products/ProductView.js @@ -34,6 +34,7 @@ var ProductView = ScrollableView.extend({ size: null, color: null, code: null, + is_onesize: false, sizes: null, colors: null, @@ -105,6 +106,8 @@ var ProductView = ScrollableView.extend({ var sizes = this.find_sizes_for_color(default_color_id) var size = sizes[0] var size_label = this.sizes[size].label + + this.is_onesize = !! this.sizes[1] // console.log(color, color_label, size, size_label) @@ -158,7 +161,7 @@ var ProductView = ScrollableView.extend({ colors[ color['ColorId'] ] = { id: color['Code10'], code: color['Code10'], - label: color['ColorDescription'], + label: color['ColorDescription'].toUpperCase(), sizes: {}, } }) @@ -167,7 +170,7 @@ var ProductView = ScrollableView.extend({ size_lookup[ label ] = size['SizeId'] sizes[ size['SizeId'] ] = { id: label, - label: label, + label: label.toUpperCase(), colors: {}, } }) @@ -182,6 +185,7 @@ var ProductView = ScrollableView.extend({ }, select_size: function(){ + if (this.is_onesize) { return this.select_color() } if (this.item['Sizes'].length == 0) { return } var sizes = Object.keys(this.sizes).map(function(key){ return this.sizes[key] @@ -251,6 +255,7 @@ var SIZE_LOOKUP = { "XL": "X-LARGE", "XXL": "XX-LARGE", "3XL": "3X-LARGE", + "OneSize": "ONESIZE", } var SIZE_ORDER = "XS S M L XL XXL 3XL".split(" ") |
