Below are documented:
checkout-addresses.html page to enter billing and shipping addressescheckout-methods.html page to choose payment and shipping methodscheckout-review.html summary page before order confirmationcheckout-confirmation.html page that confirms the completed ordercheckout-quote-request.html page for completing and sending a quote requestcheckout-cart.html page to display the cart during checkoutcheckout-form.html pageIn addition to these, you can also use the variables common to all pages.
First checkout page where billing and shipping addresses are entered.
var (
// Checkbox to accept the terms of sale and
// the privacy policy.
acceptTerms html
// Button to proceed with the order.
buttonContinue html
// Button to return to the cart.
buttonGoBack html
// Cart.
// Available starting from version 7.2.
cart CheckoutCart
// City.
city TextField
// VAT number.
companyCode TextField
// REA.
companyCode2 TextField
// Company name.
companyName TextField
// Page content.
content html
// Country.
country html
// Email address.
email TextField
// Fax number.
faxNumber TextField
// First name.
firstName TextField
// Page image.
image AlignedImage
// Recipient code or PEC address for the electronic invoice.
invoiceRecipient TextField
// Last name.
lastName TextField
// Mobile number.
mobileNumber TextField
// Tax code.
personalCode TextField
// Phone number.
phoneNumber TextField
// Postal code.
postalCode TextField
// Privacy processing under GDPR.
processings []Processing
// Shipping city.
shipCity TextField
// Shipping country.
shipCountry html
// Shipping recipient name.
shipName TextField
// Shipping postal code.
shipPostalCode TextField
// Shipping province/state.
shipStateProv html
// Shipping address line.
shipStreet1 TextField
// Shipping address line 2.
shipStreet2 TextField
// Checkbox to ship to an address different
// from the billing address.
shipToAnotherAddress html
// Province/State.
stateProv html
// Message indicating form validation errors.
statusMessage html
// Address line.
street1 TextField
// Address line 2.
street2 TextField
)
Second checkout page where the customer chooses payment and shipping methods.
To complete the order directly from this page (for example when using Stripe as the payment system), use the buttonOrder variable to show the order button.
To show the customer an order summary page after this page, use the buttonContinue variable instead of buttonOrder.
The buttonOrder and buttonContinue variables should not be used together on the same page.
var (
// Button to proceed to checkout-review.html.
// Use buttonOrder if you use Stripe as the payment system or
// if you want to complete the order immediately.
buttonContinue html
// Button to return to addresses.
buttonGoBack html
// Button to confirm and place the order.
buttonOrder html
// Cart.
// Available starting from version 7.2.
cart CheckoutCart
// Page content.
content html
// Page image.
image AlignedImage
// Payment methods.
payments []PaymentMethod
// Customer requests.
requests html
// Shipping methods.
shippings []ShippingMethod
// Message indicating any form errors.
statusMessage html
)
Order summary where you can verify all previously entered data before confirming the order.
This page is displayed when the buttonContinue variable is used on checkout-methods.html instead of buttonOrder.
The following variables are deprecated starting from version 7.2: discount, discounts, items, payment, paymentCost, prediscountSubtotal, shipping, shippingCost, subtotal, taxAmount, total and weight. You can still use them, but it is recommended to use the fields of the cart variable instead.
var (
// Billing address.
billingAddress html
// Button to return to payment and shipping methods.
buttonGoBack html
// Button to confirm and place the order.
buttonOrder html
// Cart.
// Available starting from version 7.2.
cart CheckoutCart
// VAT number.
companyCode string
// REA.
companyCode2 string
// Page content.
content html
// Email address.
email string
// Fax number.
faxNumber string
// Page image.
image AlignedImage
// Mobile number.
mobileNumber string
// Tax code.
personalCode string
// Phone number.
phoneNumber string
// Customer requests.
requests string
// Shipping address.
shippingAddress html
)
Last checkout page where the just-placed order is confirmed. If an online payment is required, the button to proceed will be shown.
After payment, this page is shown again with the transaction result. With some payment methods you can retry the payment if it fails.
var (
// Button to pay online.
buttonPay html
// Page content.
content html
// Order ID. Can be used to read the order with the
// Storefront API or read and modify it with the Commerce API.
id int
// Page image.
image AlignedImage
// Order number. Has the same value as order.Number.
number string
// Payment method.
payment string
// Indicates whether payment was executed and approved.
paymentApproved bool
// Indicates whether a payment error occurred.
paymentError bool
// Indicates whether payment was executed but failed.
paymentFailed bool
// Instructions for making payment.
paymentInstructions string
// Indicates whether the payment status is unknown.
paymentUnknown bool
// Order token. Can be used to read the order with the
// Storefront API.
token string
// Order total. Has the same value as order.Total.
total Price
)
Completing and sending the quote request. This page is reached when the cart is a quote and the customer proceeds with the quote request.
The items variable is deprecated starting from version 7.2. Use cart.Items instead, which has the same type.
var (
// Checkbox to accept the terms of sale and
// the privacy policy.
acceptTerms html
// Button to return to the cart.
buttonGoBack html
// Button to send the quote request.
buttonSendQuoteRequest html
// Cart.
// Available starting from version 7.2.
cart CheckoutCart
// City.
city TextField
// VAT number.
companyCode TextField
// REA.
companyCode2 TextField
// Company name.
companyName TextField
// Page content.
content html
// Country.
country html
// Email address.
email TextField
// Fax number.
faxNumber TextField
// First name.
firstName TextField
// Page image.
image AlignedImage
// Recipient code or PEC address for the electronic invoice.
invoiceRecipient TextField
// Last name.
lastName TextField
// Mobile number.
mobileNumber TextField
// Tax code.
personalCode TextField
// Phone number.
phoneNumber TextField
// Postal code.
postalCode TextField
// Privacy processing under GDPR.
processings []Processing
// Customer requests.
requests html
// Shipping city.
shipCity TextField
// Shipping country.
shipCountry html
// Shipping recipient name.
shipName TextField
// Shipping postal code.
shipPostalCode TextField
// Shipping province/state.
shipStateProv html
// Shipping address line.
shipStreet1 TextField
// Shipping address line 2.
shipStreet2 TextField
// Checkbox to ship to an address different
// from the billing address.
shipToAnotherAddress html
// Province/State.
stateProv html
// Message indicating any form errors.
statusMessage html
// Address line.
street1 TextField
// Address line 2.
street2 TextField
)
Confirmation page indicating that the quote request was sent.
var (
// Page content.
content html
// Page image.
image AlignedImage
)
During checkout, on the checkout-methods.html page, when a customer selects a payment or shipping method, the cart on the page is automatically updated. To update it, Open2b looks for an element with id equal to design-checkout-cart and replaces its content with the output of checkout-cart.html.
The checkout-cart.html page is used to display the cart during checkout. The usual way to do this is to add code like the following to checkout-methods.html:
<div id="design-checkout-cart">
{{ render "/checkout-cart.html" }}
</div>
This way, when the checkout-methods.html page is called, the cart is shown and then, when the customer chooses a payment or shipping method, only the cart is updated without reloading the entire page.
Since the cart in checkout is also available on checkout-addresses.html, checkout-review.html, and checkout-quote-request.html with the same variables as checkout-cart.html, you can use the same HTML code on those pages as well as on checkout-methods.html.
The checkout-cart.html page is available starting from version 7.2.
The following variables are available exclusively on the checkout-cart.html page:
var (
// Cart.
cart CheckoutCart
// Site currencies.
currencies Currencies
// Current currency.
currency Currency
// Identifier of the customer's customer group or
// the main customer group if the customer is not logged in.
customerGroup int
// Indicates whether the customer is logged in.
isLoggedIn bool
// Current language.
language Language
// Site languages.
languages Languages
// Indicates whether taxes are excluded from prices.
taxesAreExcluded bool
)
var (
// Checkbox to accept the terms of sale and
// the privacy policy.
acceptTerms html
// Button to return to the cart.
buttonGoBack html
// Button to confirm and place the order.
buttonOrder html
// City.
city TextField
// VAT number.
companyCode TextField
// REA.
companyCode2 TextField
// Company name.
companyName TextField
// Page content.
content html
// Country.
country html
// Coupon currently applied to the cart.
// It is an empty string if no coupon is applied.
currentCoupon string
// Percentage or fixed discount on the order.
discount Discount
// Discounts applied to the cart total cost.
discounts []Discount
// Email address.
email TextField
// Fax number.
faxNumber TextField
// First name.
firstName TextField
// Page image.
image AlignedImage
// Recipient code or PEC address for the electronic invoice.
invoiceRecipient TextField
// Product SKUs being ordered.
items []CartItem
// Last name.
lastName TextField
// Mobile number.
mobileNumber TextField
// Payment method.
payment html
// Payment methods.
payments []PaymentMethod
// Payment cost, for example due to a fee or cash-on-delivery charge.
paymentCost Price
// Tax code.
personalCode TextField
// Phone number.
phoneNumber TextField
// Postal code.
postalCode TextField
// Total cost before applying any discount.
prediscountSubtotal Price
// Privacy processing under GDPR.
processings []Processing
// Form the customer can fill in with specific requests about the
// product. Present only if it is a quote.
requests html
// Shipping city.
shipCity TextField
// Shipping country.
shipCountry html
// Shipping recipient name.
shipName TextField
// Shipping method.
shipping html
// Shipping cost.
shippingCost Price
// Shipping methods.
shippings []ShippingMethod
// Shipping postal code.
shipPostalCode TextField
// Shipping province/state.
shipStateProv html
// Shipping address line.
shipStreet1 TextField
// Shipping address line 2.
shipStreet2 TextField
// Checkbox to ship to an address different
// from the billing address.
shipToAnotherAddress html
// Province/State.
stateProv html
// Message indicating form validation errors.
statusMessage html
// Address line.
street1 TextField
// Address line 2.
street2 TextField
// Total cost.
subtotal Price
// Total tax amount.
taxAmount Price
// Indicates whether the cart is a quote.
toQuote bool
// Total.
total Price
// Total weight of the rows.
weight Decimal
)