From 6a8e38d24c4866b8559f7116eac694fbf1da4ded Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 9 Nov 2015 16:21:27 -0500 Subject: profile html, search api --- StoneIsland/www/js/sdk/product.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'StoneIsland/www/js') diff --git a/StoneIsland/www/js/sdk/product.js b/StoneIsland/www/js/sdk/product.js index 2cf58452..55f1940a 100644 --- a/StoneIsland/www/js/sdk/product.js +++ b/StoneIsland/www/js/sdk/product.js @@ -1,11 +1,13 @@ sdk.product = (function(){ var product = {} + + var default_gallery = 31617 product.collection = function(opt){ return $.ajax({ method: "GET", url: sdk.path("Search.API/1.2", "search.json"), - data: { format: "full", gallery: opt.gallery_id }, + data: { format: "full", gallery: opt.gallery_id || default_gallery, productsPerPage: 100 }, success: opt.success, error: opt.error, }) @@ -21,5 +23,15 @@ sdk.product = (function(){ }) } + product.search = function(opt){ + return $.ajax({ + method: "GET", + url: sdk.path("Search.API/1.2", "search.json"), + data: { format: "full", gallery: opt.gallery_id || default_gallery, textSearch: opt.query, productsPerPage: 100 }, + success: opt.success, + error: opt.error, + }) + } + return product })() \ No newline at end of file -- cgit v1.2.3-70-g09d2