CartThrob 9 documentation for ExpressionEngine commerce teams Visit CartThrob.com
CartThrob.com

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:

  1. shipping option selection
  2. shipping totals/conditionals
  3. shipping address capture in cart/checkout flows
  4. 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_option value to cart shipping info and optionally redirect (legacy helper).

Shipping Info Tags

Use these tags to show shipping totals and shipping-related cart state.

Shipping Form Flow Tags

These tags are commonly used together on shipping pages to capture address data and persist shipping selections before checkout.

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:

  1. Shipping from location (this is handled in the settings for the shipping plugin by default)
  2. Shipping to location (customer shipping address, or billing address when shipping address is not available)
  3. Package weight
  4. Package size (length x width x height)
  5. Shipping to location type (residential or commercial)
  6. Shipping from location type (residential or commercial)
  7. Package type (defined by the carrier)
  8. Shipping method (for example Ground, Overnight, Priority)
  9. Shipping time (the time of day packages are shipped)
  10. 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.