diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-09 16:21:27 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-09 16:21:27 -0500 |
| commit | 6a8e38d24c4866b8559f7116eac694fbf1da4ded (patch) | |
| tree | b45774ad4cec0fa214f59a0e8609ef12c0273125 /StoneIsland/www/js | |
| parent | aa93b03e1862e9f95570653d52b9d5858171d22f (diff) | |
profile html, search api
Diffstat (limited to 'StoneIsland/www/js')
| -rw-r--r-- | StoneIsland/www/js/sdk/product.js | 14 |
1 files changed, 13 insertions, 1 deletions
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 |
