Global Tag Variables

These tags are available in all CartThrob forms and in the Cart Info, Cart Items Info, and Customer Info tag pairs.

Table of Contents

Cart Info Variables

These variables output data from the current cart. Each variable is available in the tag pairs listed above.

cart_subtotal

Cart total minus shipping and tax, without discounts applied

{cart_subtotal}
$11.95

cart_tax

The amount of tax calculated for all items in the cart.

{cart_tax}
$1.95

cart_shipping

Cost of shipping for all items in the cart

{cart_shipping}
$13.95

cart_discount

Discounted amount for all items in the cart

{cart_discount}
$10.95

cart_total

Cart total including shipping and tax, without discounts applied

{cart_total}
$13.95

cart_subtotal_numeric

Cart total minus shipping and tax, without discounts applied, without any number formatting. Useful in conditionals.

{cart_subtotal_numeric}
11.95

cart_tax_numeric

The amount of tax calculated for all items in the cart, without any number formatting. Useful in conditionals.

{cart_tax_numeric}
1.95

cart_shipping_numeric

Cost of shipping for all items in the cart, without any number formatting. Useful in conditionals.

{cart_shipping_numeric}
13.95

cart_discount_numeric

Discounted amount for all items in the cart, without any number formatting. Useful in conditionals.

{cart_discount_numeric}
10.95

cart_total_numeric

Cart total including shipping and tax, without discounts applied, without any number formatting. Useful in conditionals.

{cart_total_numeric}
13.95

cart_tax_rate

The current tax rate being used to calculate the cart total.

{cart_tax_rate}
7%

cart_tax_name

The name of the current tax rate being used to calculate the cart total.

{cart_tax_name}
California

total_items

The total number of items in the cart (number of items X quantity)

{total_items}
12

total_unique_items

The total number of unique items in the cart. This ignores quantities, and looks solely at the total number of unique products.

{total_unique_items}
2

cart_entry_ids

A pipe delimited list of product entry IDs currently in the cart

{cart_entry_ids}
1|12|123|1234

shipping_option

The user's selected shipping option, if applicable to the shipping plugin you are using.

{shipping_option}
UPS-By Weight Global Rate

Customer Info Variables

These tags allow you to access customer data that has been saved to the cart session using save_customer_info_form, update_cart_form, or any other CartThrob form. If you have a multi-page checkout, this tag paired with update_cart_form makes it easy to collect and reuse customer information throughout the customer's shopping experience.

Each input listed in global form fields has a matching output variable here. Each variable is prefixed with customer_ to avoid name collision with ExpressionEngine's member profile variables and other custom_fields used in your channels.

customer_first_name

{customer_first_name}
King

customer_last_name

{customer_last_name}
Randor

customer_address

{customer_address}
1 Miro Way

customer_address2

{customer_address2}
Turret 1

customer_city

{customer_city}
Eternia

customer_state

{customer_state}
ET

customer_zip

{customer_zip}
63303

customer_company

{customer_company}
Mattel

customer_country

{customer_country}
United States

customer_country_code

{customer_country_code}
USA

customer_region

{customer_region}
Trondheim

customer_phone

{customer_phone}
555-555-5555

customer_email_address

{customer_email_address}
[email protected]

customer_shipping_first_name

{customer_shipping_first_name}
Queen

customer_shipping_last_name

{customer_shipping_last_name}
Marlena

customer_shipping_address

{customer_shipping_address}
1 Miro Way

customer_shipping_address2

{customer_shipping_address2}
Spire 12

customer_shipping_city

{customer_shipping_city}
Eternia

customer_shipping_state

{customer_shipping_state}
ET

customer_shipping_zip

{customer_shipping_zip}
63303

customer_shipping_company

{customer_shipping_company}
Mattel

customer_shipping_country

{customer_shipping_country}
United States

customer_shipping_country_code

{customer_shipping_country_code}
USA

customer_shipping_company

{customer_shipping_company}
Mattel

customer_ip_address

{customer_ip_address}
192.168.1.1

customer_weight_unit

{customer_weight_unit}
lbs

customer_language

{customer_language}
en

customer_use_billing_info

{customer_use_billing_info}
Yes

customer_description

{customer_description}
Equipment Purchase

customer_card_type

{customer_card_type}
Visa

customer_expiration_month

{customer_expiration_month}
01

customer_expiration_year

{customer_expiration_year}
12

customer_po_number

{customer_po_number}
123456

customer_card_code

{customer_card_code}
123

customer_CVV2

{customer_CVV2}
1234

customer_issue_number

{customer_issue_number}
123

customer_transaction_type

{customer_transaction_type}
Digital Goods

customer_bank_account_number

{customer_bank_account_number}
123456789

customer_check_type

{customer_check_type}
Commercial

customer_account_type

{customer_account_type}
Checking

customer_routing_number

{customer_routing_number}
0812345

customer_begin_month

{customer_begin_month}
02

customer_begin_year

{customer_begin_year}
09

customer_bday_month

{customer_bday_month}
08

customer_bday_day

{customer_bday_day}
02

customer_bday_year

{customer_bday_year}
75

customer_currency_code

{customer_currency_code}
USD

customer_shipping_option

{customer_shipping_option}
Ground

customer_success_return

{customer_success_return}
/mysite/success

customer_cancel_return

{customer_cancel_return}
/mysite/fail

custom_data:your_data_field_name

Prints out custom data saved in the save_customer_info_form.

{custom_data:your_data_field_name}

Parameters

variable_prefix

This parameter allows you to set a custom prefix for the variables contained within the form tag pair. This is useful to avoid variable collisions when nesting multiple tag pairs.

variable_prefix="custom_prefix:"

{exp:cartthrob:checkout_form variable_prefix="custom_prefix:"}
    {if custom_prefix:no_results}
        NO RESULTS
    {/if}
    {custom_prefix:cart_total}
{/exp:cartthrob:checkout_form}