Creates a checkout from the current site visitor’s cart.
The createCheckoutFromCurrentCart()
function returns a Promise that resolves to the new checkout's ID when it's created.
If a checkout was already created from the current cart, that checkout will be updated with any new information from the cart.
Note: options.channelType
is a required field.
function createCheckoutFromCurrentCart(
options: CreateCheckoutFromCurrentCartOptions,
): Promise<CreateCheckoutResponse>;
Checkout creation options.
import { currentCart } from "@wix/ecom";
async function createCheckoutFromCurrentCart(options) {
const response = await currentCart.createCheckoutFromCurrentCart(options);
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.