diff options
Diffstat (limited to 'StoneIsland/www/js/sdk/product.js')
| -rwxr-xr-x | StoneIsland/www/js/sdk/product.js | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/StoneIsland/www/js/sdk/product.js b/StoneIsland/www/js/sdk/product.js index 7c12e7d7..671d1fea 100755 --- a/StoneIsland/www/js/sdk/product.js +++ b/StoneIsland/www/js/sdk/product.js @@ -2,20 +2,41 @@ sdk.product = (function(){ var product = {} var default_gallery = 31617 + var default_department = "NkXStnsl" product.all = function(opt){ return $.ajax({ method: "GET", - url: sdk.path("Search.API/1.2", "search.json"), + url: sdk.path("Search.API/1.3", "search.json"), data: { format: "full", productsPerPage: 100 }, success: opt.success, error: opt.error, }) } - + product.collection = function(opt){ return $.ajax({ method: "GET", + url: sdk.path("Search.API/1.3", "search.json"), + data: { format: "full", department: opt.department_id || default_department, productsPerPage: 100 }, + success: opt.success, + error: opt.error, + }) + } + + product.department_codes = function(opt){ + return $.ajax({ + method: "GET", + url: sdk.path("Search.API/1.3", "search/results.json"), + data: { format: "full", department: opt.department_id || default_department, page: 1 }, + success: opt.success, + error: opt.error, + }) + } + + product.collection_by_gallery = function(opt){ + return $.ajax({ + method: "GET", url: sdk.path("Search.API/1.2", "search.json"), data: { format: "full", gallery: opt.gallery_id || default_gallery, productsPerPage: 100 }, success: opt.success, |
