shopp('collection.subcategories')

Loops through the loaded sub-categories in a given category to display information specific to a single sub-category in the collection.

This tag requires calling shopp('collection','has categories') before this tag will operate correctly. This is a construct similar to “The Loop” in WordPress and operates in much the same manner. Subcategory tags use the same tag properties of the Category Tags to display information specific to the current sub-category in the loop. However, subcategory information must be called using shopp('subcategory') tags and not shopp('collection').

Options

Universal Options

All Theme API calls have these options.

  • return: when set to true, 1, or on, this option forces the tag to return the value instead of displaying/echoing the value to the page. Alternatively, prefix the tag parameter with get to get the same effect. All theme api tags that return a boolean value will return by default.
  • echo: when set to false, 0, or off, this option forces the tag to display the value to the page. This is the default for all non-boolean tags.
  • is: when set to true, 1, or on, this option will evaluate the return of the theme api call as a boolean true or false value. See how values are converted to boolean.

Examples

<?php while(shopp('collection','subcategories')) { … } ?>
<?php if(shopp('collection','hascategories')):
    while(shopp('collection','subcategories')): ?>
    <a href="<?php shopp('subcategory','url'); ?>">
    <?php shopp('subcategory','coverimage'); ?>
    <?php shopp('subcategory','name'); ?></a>
<?php endwhile; endif;?>

See Also

You must be logged in to post a comment.

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

Skip to toolbar