Checkout address

The checkout form allows a user to submit an order for payment.

Once the checkout form is successfully submitted, an order is created on the platform (subsequently marked as a paid order if payment is successful, or an unpaid order if it isn't).

The action attribute of the product form needs to be set to the product url, i.e. action="/checkout/address"

The method attribute should be post.


Form fields

The platform requires that both the delivery and billing details are submitted with the checkout form.

The form has the following text fields available. You should set the name attribute to that shown below:

shipping_company
shipping_name

shipping_email
shipping_phone
shipping_address1
shipping_address2
shipping_address3
shipping_city
shipping_postcode
shipping_country
company
name
email
phone
billing_address1
billing_address2
billing_address3
billing_city
billing_postcode
billing_country


Implementation

Depending on the theme that you are using, the above fields will be constructed using different methods and macros.

You can contact us if you have specific questions about your checkout fields.


Required fields

The following fields are required:

shipping_name
shipping_email
shipping_address1
shipping_city
shipping_postcode
shipping_country
name
email
billing_address1
billing_city
billing_postcode
billing_country


Marketing

A field with the name marketing can be included with a value of 1 to add the customer to the marketing list.


customer_sources

If the customer sources/how you heard about us app is installed, a list of available customer sources, for the user to choose from, can be rendered as below.

<select name="source">
    {% for customer_source in customer_sources %}
        <option value="{{ customer_source }}">{{ customer_source }}</value>
    {% endfor %}
</select>

Terms & conditions

It is a platform requirement that a field with the name attribute set to terms has a value of 1 in order to indicate that the user has accepted the website terms and conditions of sale.

<input type="checkbox" name="terms" value="1">

(this can be set to a hidden field if required).


Checkout buttons

A website can have numerous payment options enabled, allowing the user to submit an order in different ways.

The below example shows how 'checkout buttons' can be rendered to allow the user to submit the checkout/address form.

{% for button in checkout.buttons %}
    {% if button.name == 'paypal_button' %}
        <button name="{{ button.name }}">PayPal</button>
    {% elseif button.name == 'offline_payment_button' %}
        <button name="{{ button.name }}">Offline Payment</button>
    {% else %}
        <button name="{{ button.name }}">Pay By Card</button>
    {% endif %}
{% endfor %}