Submitting to Cart
In the checkout flow, the user is typically asked to provide information – e.g. and address – and make some selections and then submit the cart to become an order.
The cart can handle the following:
- Billing details
- Delivery details
- Creating a user during checkout
- Selecting a payment method
- Selecting a shipping method
- Applying vouchers
- Paying with loyalty points
- Using a gift card
- Creating a recurring order
- Paying with a saved card
- Opt-ins
- Custom fields
To submit something to cart you submit a form with the id ordersubmit and the features you want to implement:
In order for the cart to receive this information the input fields being submitted must have specific IDs, names & values. You can read more about each feature below.
Billing details
Billing details are submitted using input fields with IDs listed below. Most of these can be matched with a specific user field, but a few are for billing-specific information like an EAN number or a VAT number. There’s also a comment field.
Field name & id |
Notes |
EcomOrderCustomerCompany |
|
EcomOrderCustomerName |
|
EcomOrderCustomerTitle |
|
EcomOrderCustomerFirstName |
|
EcomOrderCustomerSurname |
|
EcomOrderCustomerMiddleName |
|
EcomOrderCustomerHouseNumber |
|
EcomOrderCustomerInitials |
|
EcomOrderCustomerPrefix |
|
EcomOrderCustomerAddress |
|
EcomOrderCustomerAddress2 |
|
EcomOrderCustomerZip |
|
EcomOrderCustomerCity |
|
EcomOrderCustomerCountry |
This field controls which payment methods & shipping methods can be selected on the cart. |
EcomOrderCustomerRegion |
|
EcomOrderCustomerPhone |
|
EcomOrderCustomerFax |
|
EcomOrderCustomerCell |
|
EcomOrderCustomerEmail |
|
EcomOrderCustomerVatRegNumber |
|
EcomOrderCustomerEAN |
|
EcomOrderCustomerRefId |
|
EcomOrderCustomerComment |
Maps to the customer comment order details field. |
Delivery details
Delivery details are submitted to cart in the same way as billing details – and are in fact almost identical to billing details.
The 'Copy customer info to delivery info fields if empty'-checkbox under Settings > Ecommerce > Advanced Configuration > Shopping cart allows you to copy billing address field values to the delivery address fields if no part of the delivery address has been filled out.
Field name & id |
Notes |
EcomOrderDeliveryCompany |
|
EcomOrderDeliveryName |
|
EcomOrderDeliveryFirstName |
|
EcomOrderDeliveryTitle |
|
EcomOrderDeliverySurname |
|
EcomOrderDeliveryHouseNumber |
|
EcomOrderDeliveryMiddleName |
|
EcomOrderDeliveryInitials |
|
EcomOrderDeliveryPrefix |
|
EcomOrderDeliveryAddress |
|
EcomOrderDeliveryAddress2 |
|
EcomOrderDeliveryZip |
|
EcomOrderDeliveryCity |
|
EcomOrderDeliveryCountry |
|
EcomOrderDeliveryRegion |
|
EcomOrderDeliveryPhone |
|
EcomOrderDeliveryFax |
|
EcomOrderDeliveryCell |
|
EcomOrderDeliveryEmail |
|
Creating a user during checkout
To create a user or update an existing user during checkout, submit a field with the name and ID EcomUserCreateNewOrUpdate alongside fields specifying a user name and a password.
Field name & Id |
Notes |
EcomUserCreateNewOrUpdate |
Older implementations used EcomUserCreateNew |
EcomUserCreateUserName |
|
EcomUserCreatePassword |
|
EcomUserCreateConfirmPassword |
|
Payment Methods
Payment methods are submitted to cart using input elements with the name EcomCartPaymethodID and an id of the type EcomCartPaymethodID_{PaymentMethodID}, with PaymentMethodID replaced by a valid id.
Field Name & ID |
Notes |
EcomCartPaymethodId |
|
Some payment methods support inline payment in which case the payment form can be rendered directly in the cart template. The contents of the payment form is payment method-specific and typically comes from a template on the payment method.
Shipping methods
Shipping methods are submitted to cart using input elements with the name EcomCartShippingMethodId and an id of the type EcomCartShippingMethodId_{ShippingMethodID} with ShippingMethodID being replaced by a valid id.
Field Name & ID |
Notes |
EcomCartShippingmethodId |
|
EcomCartPaymethodId |
|
Some shipping providers can provide you with more content – e.g. a list of parcel shops or parcel types – which must also be submitted to cart. This information is shipping method specific, and typically comes from a template set on the shipping method.
Vouchers
Vouchers are applied to an order by submitting a valid voucher code in a field with the ID EcomOrderCustomerVoucher.
Field Name & ID |
Notes |
EcomOrderVoucherCode |
|
Loyalty points
To apply loyalty points to an order you submit a field with the ID EcomOrderPointsToUse and a value in loyalty points
Field Name & ID |
Notes |
EcomOrderPointsToUse |
|
In this example I first check of the current user is logged in – if she is, I retrieve her points balance and check if she can pay with points.
Gift cards
Gift Cards are applied to an order by submitting a valid gift card code to a field with the ID EcomOrderGiftCardCode.
Field Name & ID |
Notes |
EcomOrderGiftCardCode |
|
Recurring orders
To create a recurring order you must first check of the payment method supports recurring orders. If it does, you must submit a boolean field with the id & name EcomRecurringOrderCreate alongside an interval, an interval unit, and a start and end date.
Field Name & ID |
Value |
Notes |
EcomRecurringOrderCreate |
|
|
EcomOrderRecurringInterval |
- |
|
EcomOrderRecurringIntervalUnit |
0 = days 1 = weeks 2 = months |
|
EcomOrderRecurringEndDate |
|
|
EcomOrderRecurringEndDate_year |
|
|
EcomOrderRecurringEndDate_month |
|
|
EcomOrderRecurringEndDate_day |
|
|
EcomOrderRecurringStartDate |
|
Saved Cards
Saved cards – which are actually saved payment methods – are saved by submitting a boolean field with the id EcomOrderSavedCardCreate_{PaymethodID} alongside a field specifying the name of the saved card. You should ensure that the payment method supports saved cards - at the time of writing this is:
To use a saved card you submit a field with the ID EcomCartSavedCardID_{SavedCardId}, with SavedCardId being the id of a saved card. Make sure you clear any previously selected payment method when a saved card is submitted.
Field Name & ID |
Notes |
EcomOrderSavedCardCreate_{PaymethodID} |
Paymethod – not PaymentMethod |
EcomOrderSavedCardName |
|
|
|
EcomCartSavedCardID_{SavedCardID} |
|
Please note that it’s usually a good idea to let customers see and edit/remove the cards they have saved – like most self-service operations, this is done via the Customer Center.
Opt-Ins
From the cart you can change the value of the Email permission field on the logged in user, and the user can be asked to accept the Terms & Conditions.
Field Name & Id |
Notes |
EcomOrderSubscribeToNewsletter |
|
EcomOrderCustomerAccepted |
|
In your template, you can check if the shopping cart has Use email subscription checked in the cart settings:
Custom Fields
Custom fields – such as order fields or a coupon field– are posted to the cart using input elements which take the system name as the field name. No ID is necessary.