From 9836f109c38d7f02c587329795e80e15ff33aafa Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Tue, 10 Oct 2023 17:09:23 +0700 Subject: add qty di nenu brang , filter ready stock, filter haga fix di page search --- src/pages/api/shop/search.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/pages/api') diff --git a/src/pages/api/shop/search.js b/src/pages/api/shop/search.js index b5161365..0c79831b 100644 --- a/src/pages/api/shop/search.js +++ b/src/pages/api/shop/search.js @@ -13,7 +13,8 @@ export default async function handler(req, res) { orderBy = '', operation = 'AND', fq = '', - limit = 30 + limit = 30, + stock = '' } = req.query let paramOrderBy = '' @@ -62,8 +63,9 @@ export default async function handler(req, res) { ) } - if (brand) parameter.push(`fq=manufacture_name:${brand}`) + if (brand) parameter.push(`fq=manufacture_name:${brand.replace(/,/g, ' OR ')}`) if (category) parameter.push(`fq=category_name:${category}`) + if (stock) parameter.push(`fq=stock_total_f:{1 TO *}`) // Single fq in url params if (typeof fq === 'string') parameter.push(`fq=${fq}`) -- cgit v1.2.3 From f4fb8d1f93024cfe907a5783215cf9c939dd59bc Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Wed, 11 Oct 2023 11:02:04 +0700 Subject: filter by limit rows --- src/pages/api/shop/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pages/api') diff --git a/src/pages/api/shop/search.js b/src/pages/api/shop/search.js index 0c79831b..874431e0 100644 --- a/src/pages/api/shop/search.js +++ b/src/pages/api/shop/search.js @@ -13,7 +13,7 @@ export default async function handler(req, res) { orderBy = '', operation = 'AND', fq = '', - limit = 30, + limit = '', stock = '' } = req.query -- cgit v1.2.3 From 7ada2eab1773629a3f74fe1a16ba78227953f912 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Sat, 14 Oct 2023 09:03:10 +0700 Subject: add fillterby brand di kolom pencarian --- src/pages/api/shop/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pages/api') diff --git a/src/pages/api/shop/search.js b/src/pages/api/shop/search.js index 874431e0..fd7a215a 100644 --- a/src/pages/api/shop/search.js +++ b/src/pages/api/shop/search.js @@ -13,7 +13,7 @@ export default async function handler(req, res) { orderBy = '', operation = 'AND', fq = '', - limit = '', + limit = 0, stock = '' } = req.query -- cgit v1.2.3 From 6bd88bdb765c1ecc0518abeca77eca25bde2857b Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Tue, 17 Oct 2023 14:57:48 +0700 Subject: add lebel product terjual di product card dan product detail, bugfix queri solr untuk filter brand --- src/pages/api/shop/search.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pages/api') diff --git a/src/pages/api/shop/search.js b/src/pages/api/shop/search.js index fd7a215a..31497c51 100644 --- a/src/pages/api/shop/search.js +++ b/src/pages/api/shop/search.js @@ -13,7 +13,7 @@ export default async function handler(req, res) { orderBy = '', operation = 'AND', fq = '', - limit = 0, + limit = 30, stock = '' } = req.query @@ -41,7 +41,7 @@ export default async function handler(req, res) { let offset = (page - 1) * limit let parameter = [ - 'facet.field=manufacture_name', + 'facet.field=manufacture_name_s', 'facet.field=category_name', 'facet=true', 'indent=true', @@ -49,7 +49,7 @@ export default async function handler(req, res) { `q.op=${operation}`, `q=${escapeSolrQuery(q)}`, 'qf=name_s', - `start=${offset}`, + `start=${parseInt(offset)}`, `rows=${limit}`, `sort=${paramOrderBy}`, `fq=-publish_b:false` -- cgit v1.2.3 From 38101ad7264905d0c45c333acd0a6bb3ee7d03ba Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 18 Oct 2023 11:57:15 +0700 Subject: Fix flash sale sort on search api --- src/pages/api/shop/search.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/pages/api') diff --git a/src/pages/api/shop/search.js b/src/pages/api/shop/search.js index 31497c51..ce2f7e03 100644 --- a/src/pages/api/shop/search.js +++ b/src/pages/api/shop/search.js @@ -20,10 +20,10 @@ export default async function handler(req, res) { let paramOrderBy = '' switch (orderBy) { case 'price-asc': - paramOrderBy += 'price_discount_f ASC' + paramOrderBy += 'price_tier1_v2_f ASC' break case 'price-desc': - paramOrderBy += 'price_discount_f DESC' + paramOrderBy += 'price_tier1_v2_f DESC' break case 'popular': paramOrderBy += 'search_rank_i DESC' @@ -34,6 +34,9 @@ export default async function handler(req, res) { case 'stock': paramOrderBy += 'stock_total_f DESC' break + case 'flashsale-price-asc': + paramOrderBy += 'flashsale_price_f ASC' + break default: paramOrderBy += 'product_rating_f DESC, price_discount_f DESC' break -- cgit v1.2.3 From 95e29bc42afd5d4ce2edec877fec6005c40182d3 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Wed, 18 Oct 2023 14:15:39 +0700 Subject: query default search --- src/pages/api/shop/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pages/api') diff --git a/src/pages/api/shop/search.js b/src/pages/api/shop/search.js index ce2f7e03..b4d67c5d 100644 --- a/src/pages/api/shop/search.js +++ b/src/pages/api/shop/search.js @@ -26,7 +26,7 @@ export default async function handler(req, res) { paramOrderBy += 'price_tier1_v2_f DESC' break case 'popular': - paramOrderBy += 'search_rank_i DESC' + paramOrderBy += 'product_rating_f DESC, search_rank_i DESC,' break case 'popular-weekly': paramOrderBy += 'search_rank_weekly_i DESC' -- cgit v1.2.3