Template Tags: Utilities
Utility tags provide helper operations for redirects, debugging, conversion, formatting, encryption, and runtime configuration.
Actions
- cart_empty_redirect Redirect the visitor when the current cart is empty (for example to a catalog/start page).
- field Output a single field value from a specified entry (
entry_id+field) using a legacy helper.
Bug Testing
- debug_info Output CartThrob session/cart debug data. This only returns output when CartThrob debug mode is enabled in settings.
Conversion
- arithmetic Evaluate arithmetic expressions or two-number operations for template output.
- convert_country_code Convert a country code input to the matching country name.
- view_country_name Output a country name from a supplied
country_code. - get_card_type Detect and output card brand/type from a provided card number.
- view_converted_currency Convert a price to another currency using an external API call (
xurrency.com), then format the result. - view_encrypted_string Encrypt and encode a string value for safe URL/template transport (also used on Checkout page).
- view_decrypted_string Decode and decrypt a previously encrypted string value (also used on Checkout page).
- view_formatted_number Format a raw number using CartThrob number-format settings.
Settings Related
- view_setting Output configured CartThrob setting values and selected mapped values (also used on Checkout page).
- set_config Set CartThrob runtime config values for the active visitor/session and redirect back to the current URL.
- plugin_settings Output settings values for an active/selected payment, shipping, or tax plugin.
Additional Utility Tags
- https_redirect Enforce HTTPS for the current request and optionally adjust runtime
site_urlhandling. - set_gateway Save selected gateway from request input (when gateway selection is enabled) and redirect.