-
- جمع فروشگاه: {group.total.toLocaleString("fa-IR")} تومان
-
-
-
+
{!group.meets_minimum_order && (
حداقل مبلغ سفارش برای این فروشگاه رعایت نشده است.
@@ -78,7 +49,7 @@ export default async function CartPage() {
)}
@@ -90,7 +61,7 @@ export default async function CartPage() {
تکمیل سفارش
-
+
))}
diff --git a/src/app/(customer)/(shop)/checkout/[store]/page.tsx b/src/app/(customer)/(shop)/checkout/[store]/page.tsx
new file mode 100644
index 0000000..b295587
--- /dev/null
+++ b/src/app/(customer)/(shop)/checkout/[store]/page.tsx
@@ -0,0 +1,31 @@
+import Link from "next/link";
+import { notFound } from "next/navigation";
+import { ArrowRight } from "lucide-react";
+import { getCart } from "@/lib/api/cart";
+import { requireSession } from "@/lib/auth/session";
+import { StoreCartCard } from "@/components/customer/store-cart-card";
+import { CheckoutFulfillment } from "@/components/customer/checkout-fulfillment";
+
+export default async function StoreCheckoutPage({ params }: PageProps<"/checkout/[store]">) {
+ const { store } = await params;
+ await requireSession(`/checkout/${store}`);
+ const cart = await getCart();
+ const group = cart.groups.find((g) => g.store.uuid === store);
+ if (!group) notFound();
+
+ return (
+
+ {/* Same header as /cart, same DOM-order note: first child renders right, last left. */}
+
+
+
+
+
سبد خرید
+
+
+
+
+
+
+ );
+}
diff --git a/src/components/customer/checkout-fulfillment.tsx b/src/components/customer/checkout-fulfillment.tsx
new file mode 100644
index 0000000..7ca7b10
--- /dev/null
+++ b/src/components/customer/checkout-fulfillment.tsx
@@ -0,0 +1,108 @@
+"use client";
+
+import { useState } from "react";
+import Link from "next/link";
+import type { CartGroup } from "@/types/api";
+
+/**
+ * "دریافت حضوری" vs "ارسال توسط فروشگاه" has no backing field in the Checkout API —
+ * the OpenAPI spec's Checkout schema is address_uuid/delivery_type/scheduled_at/
+ * payment_method/notes only, with delivery_type meaning express-vs-scheduled timing,
+ * not pickup-vs-delivery fulfillment. So this toggle only affects what's *displayed*
+ * here; the actual order submission (next screen) still uses the real delivery fee.
+ */
+export function CheckoutFulfillment({ group }: { group: CartGroup }) {
+ const [pickup, setPickup] = useState(false);
+ const deliveryFee = pickup ? 0 : group.delivery_fee;
+ const payable = group.items_subtotal + deliveryFee;
+
+ return (
+
+
+
نحوه دریافت
+
+
+
+
+
+
+
+
+ جمع کالاها
+ {group.items_subtotal.toLocaleString("fa-IR")} تومان
+