Package (tag pair)
package outputs package/sub-item data from either:
- a cart row (
row_id) that has sub-items, or - a product entry (
entry_id) that uses thecartthrob_packagefieldtype.
This is a legacy compatibility tag pair.
See also:
Parameters
row_id
Cart row ID. When provided and the cart item has sub-items, package variables are built from that cart item.
row_id="{row_id}"
entry_id
Product entry ID to load package field data from a cartthrob_package field.
entry_id="123"
variable_prefix
Optional variable prefix used when rendering package field output.
variable_prefix="pkg:"
Variables
Variable set depends on source:
row_idsource: sub-item variables fromcartthrob_variables->sub_item_vars(...)entry_idsource: variables emitted bycartthrob_packagefieldtypereplace_tag
Behavior and Constraints
- If
row_idis provided, tries to load that cart item. - If row item has sub-items, outputs parsed sub-item variable rows.
- If no row-item data is available and
entry_idis provided:- loads product entry
- checks for
cartthrob_packagefieldtype on that channel - runs fieldtype preprocess/replace-tag rendering for package field content
- If no package data is found, returns
no_results.
Notes:
- This tag is legacy. Many package use cases are now handled via
{package}/{packages}output inside cart_items_info and order_items.
Examples
From a cart row context:
{exp:cartthrob:package row_id="{row_id}"}
{sub:title} ({sub:entry_id})<br>
{/exp:cartthrob:package}
From product entry package field context:
{exp:cartthrob:package entry_id="{entry_id}"}
{title}<br>
{/exp:cartthrob:package}