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

Selected Shipping Option

selected_shipping_option outputs the currently selected shipping option short name.

See also:

Parameters

This tag has no tag-specific parameters.

Output

Returns the selected shipping option value (for example a short name like priority_overnight).

If no shipping option is currently saved in cart shipping info, it falls back to the shipping plugin default option.

Behavior and Constraints

  1. Reads shipping_info('shipping_option') from the cart first.
  2. If no cart value is present, returns api_cartthrob_shipping_plugins->default_shipping_option().
  3. Output is typically a short-name key (not a display label).
  4. If both cart value and plugin default are empty, output is empty.

Examples

Basic usage:

{exp:cartthrob:selected_shipping_option}

Possible output:

priority_overnight

Simple conditional usage:

{if "{exp:cartthrob:selected_shipping_option}" == "priority_overnight"}
    Expedited shipping is selected.
{/if}