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

Save Shipping Option

save_shipping_option is an immediate-execution single tag that stores a selected shipping option in the active cart session.

This is a legacy helper (module-method tag), not a form tag.

See also:

Parameters

shipping_option

Shipping option value to save.

If omitted as a tag parameter, CartThrob reads shipping_option from POST input.

shipping_option="ground"

return

Optional redirect path after save.

If omitted, no redirect is performed.

return="store/shipping"

Behavior and Constraints

  1. Resolves shipping_option from tag parameter or POST (shipping_option).
  2. Saves the value into cart shipping info (shipping_option).
  3. Saves the cart session.
  4. Redirects only when return is provided.

Notes:

  • This tag updates shipping option only. It does not fetch live rates or validate shipping plugin fields.
  • For shipping quote workflows, use get_live_rates_form.

Examples

Set shipping option directly and redirect:

{exp:cartthrob:save_shipping_option shipping_option="ground" return="store/shipping"}

Save shipping option submitted from a standard form field:

<form method="post" action="{path='store/shipping'}">
    <select name="shipping_option">
        <option value="ground">Ground</option>
        <option value="express">Express</option>
    </select>
    <input type="submit" value="Save" />
</form>
{exp:cartthrob:save_shipping_option return="store/shipping"}