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

Is Purchased Item

{exp:cartthrob:is_purchased_item} checks whether the current logged-in member has purchased a specific product entry.

This is commonly used to flag past purchases or gate member-only content.

See also:

Parameters

entry_id

Product entry ID to check against purchase history.

entry_id="{segment_2}"

Output and Behavior

  1. Single-tag output returns 1 when purchased, otherwise 0.
  2. In tag-pair mode, {is_purchased_item} is available for conditionals.
  3. Check scope is the current logged-in member (session member_id).
  4. If the user is not logged in, this check will not return purchased results.
  5. Requires CartThrob orders channel configuration.
  6. Uses the configured default order status (orders_default_status, default open) when checking prior orders.

Examples

Single-tag conditional

{if '{exp:cartthrob:is_purchased_item entry_id="123"}' }
 You have already purchased this item!
{/if}

Tag-pair conditional

{exp:cartthrob:is_purchased_item entry_id="{segment_2}"}
    {if is_purchased_item}
        Download is available for this account.
    {/if}
{/exp:cartthrob:is_purchased_item}