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

New Cart

{exp:cartthrob:new_cart} is an immediate-execution single tag. It reinitializes the cart and saves it. It is not a form tag.

See also:

Parameters

return

Optional redirect URL after processing. If omitted, no redirect occurs.

return="cart/home"

Behavior and Constraints

  1. Calls cart initialize(), which resets cart state to defaults.
  2. Saves the reinitialized cart.
  3. Redirects only when return is provided.

Example

Reinitialize cart and redirect

{exp:cartthrob:new_cart return="cart/home"}

Reinitialize cart without redirect

{exp:cartthrob:new_cart}