CheckoutProvider Component
The CheckoutProvider component creates a context for using a cart line, allowing components to access the CheckoutProvider object from the Storefront API.
Usage
import React from "react";
import { CartLineProvider } from '@airsoko/react;
import { CartItem } from "@airsoko/graphql/api-types";
const MyComponent = () => {
return <CheckoutProvider line={cartLine}>{/* Your component content */}</CheckoutProvider>;
};
export default MyComponent;Props
| Name | Description |
|---|---|
CheckoutData | Data related to the checkout process. |
Coupon | Represents a coupon used for discounts. |
CouponDiscountType | Enum representing different types of coupon discounts. |
CustomerAddress | Address information for a customer. |
PaymentMode | Represents the payment mode for the checkout process. |
Components
| Name | Description |
|---|---|
CheckoutProviderProps | Props for the CheckoutProvider component. |
Interfaces
| Name | Description |
|---|---|
CheckoutState | Interface representing the state of the checkout process. |
CheckoutContextValue | Interface representing the context value for the checkout process. |
Types & Interfaces
| Name | Description |
|---|---|
DeliveryLocation | Type representing the delivery location. |
DeliveryLocationOption | Type representing options for delivery location. |
Checkout | Type representing the checkout state. |
| Name | Description |
|---|---|
checkoutReducer | Reducer function for handling checkout state updates. |
| Name | Description |
|---|---|
defaultState | Default state for the checkout process. |