Send customer to the first step of the checkout process in a store.
Ecwid.Cart.gotoCheckout();
Customer will be sent there only if agreeing to terms and conditions is not required in the store. You can find this setting in Ecwid Control Panel > Settings > General > Legal Pages > "Show “I agree with Terms & Conditions” checkbox during checkout or check it using Ecwid.Cart.canGotoCheckout()
function.
Callback function after sending to checkout:
Ecwid.Cart.gotoCheckout(function(){
alert("Checkout process started");
});
You can also execute a callback function if a customer was successfully sent to the first step of the checkout process in a store. See example code on the right.
Subscribe to the Ecwid.OnAPILoaded
JS API event to ensure availability of this function.