summaryrefslogtreecommitdiff
path: root/src/lib/product/components/ProductSearch.jsx
diff options
context:
space:
mode:
authorHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-10-10 17:09:23 +0700
committerHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-10-10 17:09:23 +0700
commit9836f109c38d7f02c587329795e80e15ff33aafa (patch)
treec87750e00c8ff85af190a287124c2aba284f6922 /src/lib/product/components/ProductSearch.jsx
parent3c4e65912b63c7abdd51747804283dadb09082b3 (diff)
add qty di nenu brang , filter ready stock, filter haga fix di page search
Diffstat (limited to 'src/lib/product/components/ProductSearch.jsx')
-rw-r--r--src/lib/product/components/ProductSearch.jsx19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/lib/product/components/ProductSearch.jsx b/src/lib/product/components/ProductSearch.jsx
index df9aa91b..3c3dbfd2 100644
--- a/src/lib/product/components/ProductSearch.jsx
+++ b/src/lib/product/components/ProductSearch.jsx
@@ -63,13 +63,26 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null }) => {
}
}, [productFound, query, spellings])
- const brands = productSearch.data?.facetCounts?.facetFields?.manufactureName?.filter(
+ const brands = []
+ for (
+ let i = 0;
+ i < productSearch.data?.facetCounts?.facetFields?.manufactureName.length;
+ i += 2
+ ) {
+ const brand = productSearch.data?.facetCounts?.facetFields?.manufactureName[i]
+ const qty = productSearch.data?.facetCounts?.facetFields?.manufactureName[i + 1]
+ brands.push({ brand, qty })
+ }
+ /*const brandsList = productSearch.data?.facetCounts?.facetFields?.manufactureName?.filter(
(value, index) => {
if (index % 2 === 0) {
- return true
+ const brand = value
+ const qty = index + 1
+ brands.push({ brand, qty })
}
}
- )
+ )*/
+
const categories = productSearch.data?.facetCounts?.facetFields?.categoryName?.filter(
(value, index) => {
if (index % 2 === 0) {