From 64e8bbc5f2c151d59ae54262e02060c705709755 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 24 Nov 2017 20:43:29 +0100 Subject: fix canadian situation before any exclamation --- StoneIsland/www/js/sdk/_sdk.js | 5 +++-- StoneIsland/www/js/sdk/product.js | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'StoneIsland/www/js') diff --git a/StoneIsland/www/js/sdk/_sdk.js b/StoneIsland/www/js/sdk/_sdk.js index bcfb3059..ef29ff92 100755 --- a/StoneIsland/www/js/sdk/_sdk.js +++ b/StoneIsland/www/js/sdk/_sdk.js @@ -21,8 +21,8 @@ var sdk = (function(){ } } - sdk.path = function(api, path){ - return endpoint + api + "/STONEISLAND_" + sdk.cc() + "/" + path + sdk.path = function(api, path, cc){ + return endpoint + api + "/STONEISLAND_" + (cc || sdk.cc()) + "/" + path } sdk.image = function(code, size){ @@ -31,6 +31,7 @@ var sdk = (function(){ sdk.cc = function(){ return sim.data.countryCode.toUpperCase() + // return 'CA' } sdk.cms = function(){ diff --git a/StoneIsland/www/js/sdk/product.js b/StoneIsland/www/js/sdk/product.js index 671d1fea..3619b0bd 100755 --- a/StoneIsland/www/js/sdk/product.js +++ b/StoneIsland/www/js/sdk/product.js @@ -7,7 +7,7 @@ sdk.product = (function(){ product.all = function(opt){ return $.ajax({ method: "GET", - url: sdk.path("Search.API/1.3", "search.json"), + url: sdk.path("Search.API/1.3", "search.json", "US"), data: { format: "full", productsPerPage: 100 }, success: opt.success, error: opt.error, @@ -17,7 +17,7 @@ sdk.product = (function(){ product.collection = function(opt){ return $.ajax({ method: "GET", - url: sdk.path("Search.API/1.3", "search.json"), + url: sdk.path("Search.API/1.3", "search.json", "US"), data: { format: "full", department: opt.department_id || default_department, productsPerPage: 100 }, success: opt.success, error: opt.error, @@ -27,7 +27,7 @@ sdk.product = (function(){ product.department_codes = function(opt){ return $.ajax({ method: "GET", - url: sdk.path("Search.API/1.3", "search/results.json"), + url: sdk.path("Search.API/1.3", "search/results.json", "US"), data: { format: "full", department: opt.department_id || default_department, page: 1 }, success: opt.success, error: opt.error, @@ -37,7 +37,7 @@ sdk.product = (function(){ product.collection_by_gallery = function(opt){ return $.ajax({ method: "GET", - url: sdk.path("Search.API/1.2", "search.json"), + url: sdk.path("Search.API/1.2", "search.json", "US"), data: { format: "full", gallery: opt.gallery_id || default_gallery, productsPerPage: 100 }, success: opt.success, error: opt.error, -- cgit v1.2.3-70-g09d2