Cart not found when retrieving order from order ID #412
-
Hey, I am using Code: import { useRouter } from "next/router"
import { NextPageContext } from "next";
import swell from '@/lib/swell/index';
const Orders = ({ orderData }: { orderData: swell.Order }) => {
const router = useRouter()
const slug = router.query.slug
return (
<div>{slug}</div>
)
}
export const getServerSideProps = async (context: NextPageContext) => {
const data = await swell.cart.getOrder(context.query.slug as string)
console.log(data)
return {
props: {
orderDate: data
}
}
}
export default Orders |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @ItzCrazyKns are you passing in the order |
Beta Was this translation helpful? Give feedback.
-
Oh thank you so much, appreciate that |
Beta Was this translation helpful? Give feedback.
Hi @ItzCrazyKns are you passing in the order
id
or thecheckout_id
of the cart? ThegetOrder()
method requires thecheckout_id
.