nitems
Returns the total number of items in the cart.
Summary
| Parameter
|
Description
|
Default
|
| name |
The name of the cart you would like to tally. |
Current cart |
| compare |
Provide a regex to test the "qualifier" value against. |
None |
| qualifier |
The name of an item attribute that must have a true value,
or match the "compare" regex,
in order for the item to be counted. |
None |
Examples
Tag expansion example
Perl example
$Tag->nitems({
name => $name,
});
|
or similarly with positional parameters:
|
$Tag->nitems($name, $attribute_hash_reference);
|
Description
Returns the total number of items in the named cart,
or the number of items that meet the specified criteria.
Parameters
name
The name of the cart you would like to tally.
If no cart name is provided then the current cart
will be used.
compare
The specified "qualifier" attribute's value must
match this regex to be counted.
If a "qualifier" is specified,
but no "compare" regex is given,
then the comparison will be based upon a straight true
or false test of the "qualifier" attribute's
value.
qualifier
The name of an item attribute that must have a true value,
or match the "compare" regex,
in order for the item to be counted.