From e1c123f323a9c4b3d4b488ee9c8d6046d368e73b Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 20 Jan 2016 02:11:37 +0100 Subject: bump search api version --- StoneIsland/www/js/sdk/product.js | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'StoneIsland/www/js/sdk/product.js') 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,18 +2,39 @@ 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"), -- cgit v1.2.3-70-g09d2