File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed
app/[countryCode]/(checkout)/checkout
modules/checkout/templates Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export default async function Checkout() {
47
47
< Wrapper cart = { cart } >
48
48
< CheckoutForm />
49
49
</ Wrapper >
50
- < CheckoutSummary />
50
+ < CheckoutSummary cart = { cart } />
51
51
</ div >
52
52
)
53
53
}
Original file line number Diff line number Diff line change
1
+ "use server"
2
+
1
3
import {
2
4
createPaymentSessions ,
3
5
getCustomer ,
Original file line number Diff line number Diff line change
1
+ "use client"
2
+
1
3
import { Heading } from "@medusajs/ui"
2
4
3
- import { getScopedI18n } from "../../../../locales/server "
5
+ import { useScopedI18n } from "../../../../locales/client "
4
6
5
7
import ItemsPreviewTemplate from "@modules/cart/templates/preview"
6
8
import DiscountCode from "@modules/checkout/components/discount-code"
7
9
import CartTotals from "@modules/common/components/cart-totals"
8
10
import Divider from "@modules/common/components/divider"
9
- import { cookies } from "next/headers"
10
- import { getCart } from "@lib/data"
11
-
12
- const CheckoutSummary = async ( ) => {
13
- const t = await getScopedI18n ( "checkout" )
14
- const cartId = cookies ( ) . get ( "_medusa_cart_id" ) ?. value
11
+ import { Cart } from "medusa-react"
15
12
16
- if ( ! cartId ) {
17
- return null
18
- }
13
+ type CheckoutSummaryProps = {
14
+ cart : Omit < Cart , "refundable_amount" | "refunded_total" >
15
+ }
19
16
20
- const cart = await getCart ( cartId ) . then ( ( cart ) => cart )
17
+ const CheckoutSummary : React . FC < CheckoutSummaryProps > = ( { cart } ) => {
18
+ const t = useScopedI18n ( "checkout" )
21
19
22
20
if ( ! cart ) {
23
21
return null
You can’t perform that action at this time.
0 commit comments