shopp('storefront.side-product')

Display one or more side products.

shopp('storefront', 'side-product', '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|string False by default or the side product markup

Display one or more products using a condensed layout suitable for sidebars and widgets..

This Theme API call will load each product using the sideproduct-{id}.php content template if found (if the product option is used), or by the sideproduct-{id}.php content template if the more specific content template is not found. If the category option is specified instead, the sideproduct-{id}.php content template will be loaded for the category or collection, if found, otherwise the default sideproduct-{id}.php content template will be loaded.

Options

  • source: Default is product. Specifies the source of the products to display. Set to product to use the product option or set to category to use the category option.
  • product: If the source option is set to product, set one or more comma separated product IDs.
  • category: If the source option is set to category, set to the product category slug or id, or the smart collection slug to get products.
  • load: If set and the source option is set to product, the first product in the product option will be loaded into the current product context, and the this Theme API call will return boolean true. If set and the source option is set to category, the current collection context is set to the specified category or collection based on the provided category/collection id or slug in the category option.

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.

Alternative Forms

shopp('storefront','sideproduct','options');
shopp('storefront.sideproduct','options');
shopp('storefront.side-product','options');

Examples

// display product 1 using the side product template
shopp('storefront.side-product', array(
    'source' => 'product',
    'product' => 1
));
// display products 1,2,3,4 using the side product template
shopp('storefront.side-product', 'source=product&product=1,2,3,4');
// display all the random products collection using the side product template
shopp('storefront.side-product', 'source=category&category=random');
// display all the products in category apparel using the side product template
shopp('storefront.side-product', array(
    'source'=>'category',
    'category'=>'apparel'
));
// display all the products in category 1 using the side product template
shopp('storefront.side-product', 'source=category&category=1');

See Also

You must be logged in to post a comment.

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

Skip to toolbar