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
- Returns a string of product entry IDs separated by
|. - IDs are unique (duplicates are removed).
- IDs are based on cart product rows (
product_ids()), so the output represents top-level cart product IDs. - 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}