Template Tags: Cart Tags

The tags listed on this page are used to manipulate the cart and view cart information.

Adding, updating and deleting items from the cart

The following tags output forms that you can use to manipulate the contents of the cart.

These parameter driven tags automatically update the cart. Parameter based tags are useful for forcing items in or out of the cart based on visiting a specific page.

  • add_to_cart Adds a single item to the cart
  • clear_cart Clears the cart of all items and optionally all customer information
  • new_cart Clears the cart of all items and all customer information and returns the cart to its default state, removing any configuration overrides that have been set
  • delete_from_cart Delete one or all cart items
  • duplicate_item Duplicates an item in the cart
  • change_quantity Change the quantity of one item in the cart

Cart contents

These tags output information about the items in the cart and customer information.

  • cart_items_info Outputs information about items in the cart, including item subtotals and prices with tax
  • item_options Outputs selectable and selected options for items in the cart, or stored items
  • cart_entry_ids lists entry ids of items in the cart separated by a pipe | character
  • customer_info Outputs customer information. Generally you can use cart items info instead, as long as there is at least one item in the cart

Cart totals

These tags output item counts and cart totals.

Past and related purchases

Get information about past purchases, and information about items similar to those already in the cart

  • order_totals Useful for generating custom reports. Can be used similar to a channel:entries tag to filter and output information about past purchases
  • order_items Outputs information about items connected with a specific order. Can be used similar to a channel:entries tag to simplify the output of purchased items
  • also_purchased Lists items that others have purchased related to a specific item
  • is_purchased_item Used as a conditional to test whether the current customer has purchased this item in the past
  • get_items_in_range Gets a list of entry_ids of items that are in a specific price range