Save Customer Info Form (tag pair)

The save_customer_info_form, add_to_cart_form, update_cart_form, checkout_form all allow you to save customer info during your customers visit* to simplify the creation of a multi-page checkout. CartThrob form tags makes it easy to collect customer information, and output it later. You can later use saved data to populate other forms (you output the data with the customer_info tag pair). The save_customer_info_form outputs a form, but you need to add the fields yourself, example:

<input type="text" name="company" value="CartThrob" />

Required names for input fields

For security purposes, data will only be collected from inputs with the following names (except for custom_data listed below) All of these field names can later be used as variables in conjunction with the customer_info tag pair.

first_name
last_name
address
address2
city
state
zip
country
country_code
(GBR, USA)
company

phone
email_address
ip_address
description
(description of the entire order or the store itself; used by some gateways)
use_billing_info

shipping_first_name
shipping_last_name
shipping_address
shipping_address2
shipping_city
shipping_state
shipping_zip
shipping_country
shipping_country_code
shipping_company

CVV2 (the number on the back of a credit card)
card_type
expiration_month
expiration_year
po_number
issue_number
(used by certain payment gateways)
transaction_type (used by certain payment gateways)
bank_account_number
check_type
account_type
routing_number
begin_month
begin_year
bday_month
(certain payment gateways request the beginning date for credit cards)
bday_day
bday_year

currency_code (GBP, USD)
language

shipping_option
weight_unit

region (used for taxes)

success_return (when an operation with some payment gateways is complete this is where a user will be sent)
cancel_return (when an operation with some payment gateways fail this is where a user will be sent)

username
screen_name
password
password_confirm
create_member
group_id

Where is the credit_card_number field?

Because all of this data is stored in sessions, we do not store the actual credit card number for security purposes. Though the chance of data theft is probably remote, and we do not want to encourage bad security practices by storing the credit card number.

Table of Contents

In addition to the parameters listed here, you may also use any of the Global Form Parameters.

Parameters

required

Any fields required by the selected payment gateway are automatically validated. Use this parameter to require additional fields. Provide a pipe delimited list of required fields. Special values are "all" and "not".

required="shipping_first_name|shipping_last_name"
save_shipping

The default is "yes". If for some reason you don't want your form to save customer shipping selections, set this to "no".

save_shipping="yes"

Variables

See Global Tag Variables.

Form Fields

custom_data

You can save custom data to your customer info. If the data key matches the name of a field in your orders channel, that data will be saved when you place an order. You may also print out your custom data in the customer_info tag.

<input type="text" name="custom_data[something]" value="" />

Examples

{exp:cartthrob:save_customer_info_form 
    id="myform_id" 
    name="myform_name" 
    class="myform_class" 
    return="cart/order_info" 
    onsubmit="your_custom_javascript()"
    }

    <input type="text" name="first_name" value="" />
    <input type="text" name="last_name" value="" />
    {if logged_in}
        <input type="text" name="email_address" value="{logged_in_email}" />
    {/if}
    {if logged_out}
        <input type="text" name="email_address" value="" />
    {/if}

    <input type="submit" value="submit" />
{/exp:cartthrob:save_customer_info_form}