feat(inventory): link online order reservations to database hold and sync numerical stock in RSS/Torob feeds
This commit is contained in:
1 parent
01de33ff2b
commit
d6a2136c70
3 files changed
+28
-8
No files matched your search
@@ -153,11 +153,14 @@ export async function GET(request: NextRequest) {
|
||||
: `${baseUrl}${proxied.startsWith('/') ? proxied : `/${proxied}`}`;
|
||||
}
|
||||
|
||||
const isInStock =
|
||||
product.stockStatus !== 'OUT_OF_STOCK' &&
|
||||
product.stockStatus !== 'out_of_stock' &&
|
||||
product.stockStatus !== 'DISCONTINUED' &&
|
||||
product.inStock !== false;
|
||||
const isOutOfStock =
|
||||
product.stockStatus === 'OUT_OF_STOCK' ||
|
||||
product.stockStatus === 'out_of_stock' ||
|
||||
product.stockStatus === 'DISCONTINUED' ||
|
||||
product.inStock === false ||
|
||||
(typeof product.stock === 'number' && product.stock <= 0);
|
||||
|
||||
const isInStock = !isOutOfStock;
|
||||
|
||||
const price = Number(product.priceValue || product.price || 0);
|
||||
const oldPrice = Number(product.oldPrice || product.priceValue || product.price || 0);
|
||||
|
||||
Reference in new issue
Block a user