Template Tags: Shipping
Shipping behavior in CartThrob is driven by the active shipping plugin, cart contents, and customer shipping data (for example country/state/zip and selected shipping option).
Use this page as the shipping-focused tag index for:
- shipping option selection
- shipping totals/conditionals
- shipping address capture in cart/checkout flows
- live-rate quote workflows
See also: Creating Shipping Plugins.
Standard Shipping Tags
Use these tags to expose shipping choices to the customer and output the currently selected option.
- get_shipping_options Output shipping options from the active shipping plugin. With no tag pair content, this outputs a
<select name="shipping_option">; with tag pair content, it outputs option variables per row (also used on Checkout page). - selected_shipping_option Output the current shipping option value from cart shipping info; falls back to the plugin default if none is saved yet (also used on Checkout page).
- save_shipping_option Save a chosen
shipping_optionvalue to cart shipping info and optionally redirect (legacy helper).
Shipping Info Tags
Use these tags to show shipping totals and shipping-related cart state.
- cart_shipping Output shipping total from the active cart (also used on Cart page and Checkout page).
- cart_shipping_plus_tax Output shipping total including shipping tax (also used on Cart page).
- cart_subtotal_plus_shipping Output subtotal plus shipping (also used on Cart page and Checkout page).
- has_shipping Output
TRUEwhen shipping is non-zero andFALSEwhen shipping is zero (also used on Cart page). - has_shippable_items Output whether the cart includes at least one shippable item (also used on Cart page).
- cart_info Output customer info plus cart totals/counts, including shipping-related values (also used on Cart page).
Shipping Form Flow Tags
These tags are commonly used together on shipping pages to capture address data and persist shipping selections before checkout.
- update_cart_form Save shipping/customer fields and shipping option changes in one submit (also used on Cart page and Checkout page).
- save_customer_info_form Save customer/shipping fields without changing cart line items (also used on Cart page and Checkout page).
- save_customer_info Legacy immediate helper to validate/save customer+shipping fields from request data, then optionally redirect (also used in Checkout page).
- customer_info Output saved customer/shipping values for form prefill (also used on Cart page and Checkout page).
- state_select Output a state/province
<select>for shipping/billing address capture (also used on Checkout page). - country_select Output a country
<select>for shipping/billing address capture (also used on Checkout page).
Installer shipping templates also commonly show supporting cart summary tags such as cart_items_info, cart_subtotal, cart_tax, cart_total, and total_items_count while the customer updates shipping data.
Live Rates Tags
- get_live_rates_form Output a dedicated quote form that submits to the live-rates update action and includes plugin HTML fields.
- update_live_rates_action Action endpoint used by live-rates forms to validate inputs, request rates, and optionally save the cheapest returned option.
- get_shipping_options Can output live-rate options when the active plugin supports live quotes (also used on Checkout page).
Live-rate behavior depends on the installed shipping plugin. If the selected plugin supports live rates, quote accuracy depends on complete shipping data.
Typical live-rate inputs include:
- Shipping from location (this is handled in the settings for the shipping plugin by default)
- Shipping to location (customer shipping address, or billing address when shipping address is not available)
- Package weight
- Package size (length x width x height)
- Shipping to location type (residential or commercial)
- Shipping from location type (residential or commercial)
- Package type (defined by the carrier)
- Shipping method (for example Ground, Overnight, Priority)
- Shipping time (the time of day packages are shipped)
- Pickup type (regular pickup, counter drop-off, one-time pickup)
If live-rate requirements are too complex for a store’s workflow, fixed/configured shipping approaches are often easier to maintain (for example):
- Zone Rates
- Threshold Rates
- Per Location Rates
These can approximate carrier-style pricing while giving the merchant direct control over handling and operational adjustments.