shopp('product.category')

Used in the shopp('product','categories') loop to show information for each assigned category.

On its own, without any options this tag will show the name of the category.

Options

  • show: Default is (not set). Can be set to show the category id or the category slug.

Examples

Show the name of each assigned category

<?php 
while(shopp('product','categories')) { 
    shopp('product','category');
}
?>

Return each assigned category ID to a variable

<?php 
while(shopp('product','categories')) { 
    $category_id = shopp('product','category','show=id&echo=off');
}
?>

Test the slug of each assigned category

<?php 
while(shopp('product','categories')) { 
    if (shopp('product','category','show=slug&return=on') == 'category-slug') {
        // Do something spiffy
    }
}
?>

See Also

You must be logged in to post a comment.

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

Skip to toolbar