Template Tags: HTML Helpers

Many of CartThrob's tags output forms, and when capturing customer information the following tags help generate select dropdown form fields.

Select Dropdown Fields

These tags generate select fields

  • country_select Outputs a list of countries and country codes in Alpha3 format. Some payment gateways require country codes to be in Alpha2 format. CartThrob automatically converts country codes where needed. You can modify this list by editing the my_locales.php file in the CartThrob application folder
  • state_select Outputs a list of US States by default. Generally states are only required by payment processors for billing locations in the United States. If you plan to use this tag outside of the United States, you can modify the list of states shown in this list by editing the my_locales.php file in the CartThrob application folder
  • year_select
  • selected_gateway_fields Outputs default fields for a specific payment gateway
  • gateway_select Generates a list of selectable gateways. You can turn on and off gateways that will be shown in this list in the payments settings

Freeform lists

These tags generate freeform lists. They could be used to generate select fields, radio fields, or plain lists as the need arises

  • countries
  • years
  • states Outputs a list of US States by default. Generally states are only required by payment processors for billing locations in the United States. If you plan to use this tag outside of the United States, you can modify the list of states shown in this list by editing the my_locales.php file in the CartThrob application folder

Other

  • get_cartthrob_logo Outputs a CartThrob logo. If you really like CartThrob, you can show it.