summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-11-09 16:21:27 -0500
committerJules Laplace <jules@okfoc.us>2015-11-09 16:21:27 -0500
commit6a8e38d24c4866b8559f7116eac694fbf1da4ded (patch)
treeb45774ad4cec0fa214f59a0e8609ef12c0273125 /StoneIsland/www/js
parentaa93b03e1862e9f95570653d52b9d5858171d22f (diff)
profile html, search api
Diffstat (limited to 'StoneIsland/www/js')
-rw-r--r--StoneIsland/www/js/sdk/product.js14
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