diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2025-05-26 07:47:02 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2025-05-26 07:47:02 +0000 |
| commit | f601901c3a40e6b293f14d8879cc2e9e8e9d5599 (patch) | |
| tree | 7b2f3abef26b4a0b25e1405c9df7791921578548 /src/pages | |
| parent | 4ef92b4d9fea4fdd636d62194514b33ed3b3c387 (diff) | |
| parent | 77e49bf7f69a0712da632ddec5b9bd0926389955 (diff) | |
Merged in fix/ready-stock (pull request #409)
<miqdad> filter based on stock quantity for ready stock page
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/api/shop/search.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pages/api/shop/search.js b/src/pages/api/shop/search.js index a1eecc52..8ab5c87c 100644 --- a/src/pages/api/shop/search.js +++ b/src/pages/api/shop/search.js @@ -89,6 +89,10 @@ export default async function handler(req, res) { 'price_tier1_v2_f:[1 TO *]', ]; + if (orderBy === 'stock') { + filterQueries.push('stock_total_f:{0 TO *}'); // Hanya produk dengan stock > 0 + } + if (fq && source != 'similar' && typeof fq != 'string') { // filterQueries.push(fq); fq.push(...filterQueries); |
