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

Cart Entry IDs

{exp:cartthrob:cart_entry_ids} returns a pipe-delimited list of product entry_id values currently in the cart.

This is useful when you need a compact list of cart products for embeds, comparisons, or simple lookups.

See also:

Parameters

This tag does not accept parameters.

Output and Behavior

  1. Returns a string of product entry IDs separated by |.
  2. IDs are unique (duplicates are removed).
  3. IDs are based on cart product rows (product_ids()), so the output represents top-level cart product IDs.
  4. If the cart is empty, output is an empty string.

Sample output:

123|466|333|802

Examples

Basic output

{exp:cartthrob:cart_entry_ids}

Use in an embed variable

{embed="orders/create_temp" cart_entry_ids="{exp:cartthrob:cart_entry_ids}"}

Compare with cart variables in cart_info

{exp:cartthrob:cart_info}
    Entry IDs: {cart_entry_ids}
{/exp:cartthrob:cart_info}