feat(inventory): implement numeric stock inventory across fullstack and improve prescription UX handoff
This commit is contained in:
1 parent
e9582430e6
commit
741365f04c
13 files changed
+177
-47
No files matched your search
@@ -231,7 +231,13 @@ export default function ClientLayout({ children }: { children: React.ReactNode }
|
||||
onClose={() => setIsPrescriptionModalOpen(false)}
|
||||
/>
|
||||
<MobileBottomNav
|
||||
onPrescriptionOpen={() => setIsPrescriptionModalOpen(true)}
|
||||
onPrescriptionOpen={() => {
|
||||
if (!isLoggedIn) {
|
||||
setAuthModalOpen(true);
|
||||
} else {
|
||||
setIsPrescriptionModalOpen(true);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<Toaster position="top-center" expand={true} richColors closeButton />
|
||||
</>
|
||||
|
||||
@@ -122,10 +122,10 @@ export default async function ShopProductPage({ params }: { params: Promise<{ sl
|
||||
const productUrl = `${siteUrl}/shop/${resolvedParams.slug}`;
|
||||
const priceInRial = product.priceValue * 10;
|
||||
|
||||
// Map stock status and packageSize to Schema.org availability
|
||||
// Map stock status and stock quantity to Schema.org availability
|
||||
const isOutOfStock =
|
||||
product.stockStatus === 'OUT_OF_STOCK' ||
|
||||
(typeof product.packageSize === 'number' && product.packageSize <= 0);
|
||||
(typeof product.stock === 'number' && product.stock <= 0);
|
||||
|
||||
let availabilityUrl = 'https://schema.org/InStock';
|
||||
if (product.stockStatus === 'DISCONTINUED') {
|
||||
|
||||
Reference in new issue
Block a user