diff options
| author | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-10-10 17:09:23 +0700 |
|---|---|---|
| committer | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-10-10 17:09:23 +0700 |
| commit | 9836f109c38d7f02c587329795e80e15ff33aafa (patch) | |
| tree | c87750e00c8ff85af190a287124c2aba284f6922 /src/lib/product/components/ProductSearch.jsx | |
| parent | 3c4e65912b63c7abdd51747804283dadb09082b3 (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.jsx | 19 |
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) { |
