less than a minute read • Updated 9 minutes ago
Checkout variables reference
Reference for the Twig and JavaScript variables available on the checkout template, including checkout data and checkout configuration.
Everything available on the cart template is also available on the checkout, plus the following checkout-specific variables.
Checkout
Variable | Description |
|---|---|
| Used for determining if a customer opted to check out anonymously. |
| Used for determining if the Single Sign On (SSO) authorization token is valid. |
| If the customer is currently authenticating. |
| If customer authentication failed. |
| If customer authentication is successful. |
| (See cart shipping_address) |
| Credit card Card Security Code for new cards. |
| Credit card Card Security Code for existing cards. |
| Credit card expiration date month. |
| Credit card expiration date year. |
| Credit card number. |
| Masked credit card number. |
| Credit card type (Visa, MasterCard, Amex, etc) |
| If the customer as opted to change their password. |
| The date this checkout took place, formatted based on the locale (see checkout_timestamp for a raw value) |
| The type of checkout taking place which can be either default_account, default_guest, guest_only, account_only |
| The timestamp of when this checkout took place. |
| The URL used on the receipt to continue back to your store’s website. |
| Whether or not the customer chose to create an account during checkout. |
| The customer email address. |
| Used for determining which customer just logged in. |
| Used for determining if the current customer is authenticated via Single Sign On (SSO). |
| The customer password entered by the user. |
| If the checkout is currently checking to see if the email address given belongs to an existing customer. |
| Indicates if the email address given belongs to an existing customer. |
| Indicates if the email address given is valid. |
| The Single Sign On (SSO) authentication token. |
| The Single Sign On (SSO) passed in customer id. |
| If the receipt is being displayed for the very first time which can be helpful for displaying specific conversion tracking code. |
| If the customer requires a password reset because they logged in with a temporary password. |
| If the cart contains subscriptions, the customer will be forced to checkout as a named account. |
| Used in the emails sent to store administrators to display the GEO IP lookup details for the country based on the ip address of the customer checking out. This will not be available for the checkout or receipt context. |
| If the cart contains coupon discounts. |
| If the cart contains downloadable products. |
| If the customer has a saved credit card. |
| If the checkout has custom fields which are not hidden custom fields. |
| Array of hosted payment gateways available for this checkout. |
| Language and logo used on the checkout page to tell the customer they can pay with this method. |
| Additional information for the customer indicating what happens next, such as if they will be redirected to another site to confirm payment. |
| Whether or not this hosted payment method supports subscriptions. |
| The type of this hosted solution such as bitpay, dwolla, etc. |
| The links for downloading products purchased as FoxyCart downloadables. |
| The ip address of the customer. |
| If the customer checked out as an anonymous user. |
| If the customer is currently logged in using Unified Order Entry. |
| Used for determining if an animation should be displayed near the submit button. |
| Array of shipments for each multiship customer shipment (in addition to address data found in shipping_address) |
| The name given to this shipto address. This will be the same as the “shipto” value in the cart. |
| The tax total for this shipment used during checkout. |
| Custom fields for this shipment. |
| Whether or not this shipment has products from a category which uses live shipping rates. |
| Whether or not this shipment has products from a category which has any shipping or handling costs. |
| Whether or not any of the custom fields in this shipment are visible. |
| The shipto number used for visual organization. |
| The total future shipping amount in this shipment |
| The total amount of all the items in this shipment |
| The total price in this shipment |
| The total shipping amount in this shipment |
| The total tax amount in this shipment |
| When creating a new customer or changing an existing password, this will contain the new password entered by the customer. |
| The transaction id of this order. |
| True if the password this customer used has expired, such as when using a temporary password. |
| Used by 3D Secure systems. |
| If the customer checked out with a hosted gateway which first marks the payment as pending, this boolean can be used for special messaging to the customer on the receipt. |
| Either plastic_saved, plastic_new, or the type of the hosted payment gateway being used. |
| The payment type usually being plastic, hosted (as in a hosted payment gateway), purchase_order, paypal or other. |
| The payment gateway response value used on the receipt. |
| The purchase order value submitted by the customer. |
| The canonical url of the transaction receipt. |
| Array of required field names as configured in the FoxyCart admin template configuration page. |
| The default label for the shipping and/or handling fees charged for this order. |
| Used to indicate if a testing informational message is to be displayed. This can be useful for styling purposes and can be triggered by passing in a fc_show_info custom field. |
| Used in some situations such as with hosted gateways to specify the status of the current transaction. Values include approved, authorized, declined, pending, or rejected. |
| Array of subscription data for this transaction. |
| The textual description of this subscription including the frequency. |
| The subscription token url which can be used by the customer to modify or cancel this subscription or by the store to adjust the subscription via the API. |
| The links needed by the customer to modify or cancel this subscription in html format. |
| The links needed by the customer to modify or cancel this subscription in text format. |
| Indicates whether the temporary password has been sent to the customer. |
| Text links for downloading the products purchased. |
| Used by the Single Sign On (SSO) feature to ensure the token is only valid for a specific amount of time. |
| Used by 3D Secure systems. |
| The state of the terms of service checkbox, if being used by the checkout. |
| A boolean state of the checkbox for using an alternate shipping address other than the billing address. |
| The state of the checkbox for using an alternate shipping address other than the billing address. |
| Custom twig macros we’ve added which we’ve also ported to twig.js |
| Get a specific error string from the array of errors by context key. |
| Get a specific info string from the array of informational strings by context key. |
| Macro for formatting shipping rate results into radio buttons. |
| Macro for displaying the use alternate address checkbox. |
Checkout Config (FC.json.config)
Everything available in the cart config is also available in the checkout config, plus the following.
Variable | Description |
|---|---|
| Used for FoxyCart test stores. |
| Used for determining the correct base directory for this store version. |
| An array of months for displaying the credit card expiration month select box. |
| An array of years for displaying the credit card expiration year select box. |
| A boolean used for display logic when there are more than one payment options enabled by the store for the checkout page. |
| Includes language strings from cart config lang as well as additional strings for checkout, email and receipt contexts. |
| A boolean used for display logic on the checkout page for if the store supports paying with a debit or credit card. |
| A boolean used for display logic on the checkout page for if the store supports paying by purchase order. |