shopp('product.tagged')

Determines if the product is associated with a given tag name or id.

shopp('product.tagged', 'options')

@param string $object the object or object.tag combination, if object.tag is used, the tag parameter can be omitted
@param string $tag the tag, can be hyphenated or not. Prefix with 'get' as shorthand for the return=true option
@param mixed $options associative array, or url-style name=value pairs separated by ampersands (&). Each pair is passed to the theme api tag as an option.
@returns boolean true if the product is tagged with the given name; false otherwise.

Determines if the product has been tagged with the given tag name.

Options

  • name: No default value. Value entered will be tested to match the name of any tag associated with the product.
  • id: No default value. Value entered will be tested to match the tag-id of any tag associated with the product.

Examples

<?php if (shopp('product','tagged','name=tagname')) { … } ?>

Check if product tagged with ‘foo’ by ID

<?php if(shopp('product','tagged', 'id=10')) 
    echo "product is tagged foo"; ?>

Check if product tagged with ‘bar’ by tag name

<?php if(shopp('product','tagged','name=bar')) 
    echo "product tagged bar"; ?>

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar