Prints a customizable list of product bundles that contain the product set in the scope.
Kuvaus
If the value <ProductBundles supported="false" /> is set in the theme settings, the {ProductShortDesc} tag will print a list of product bundles to which the product belongs.
If the theme settings have the value <ProductBundles supported="true" />, {ProductShortDesc} will not display product bundles, so the listing must be added to the theme using the {ProductBundles} tag.
If any of the products included in the product bundle is not visible in the version that the customer is visiting, the product bundle won't be displayed on the list at all.
Näkyvyys
Toimii näkyvyydessä: tuote
Näkyvyys
Including product bundles on product lists
By using the {ProductBundles} tag, you can print product bundles' details on product lists in a way so that next to each product the list will include details of all product bundles that the product belongs to.
<!-- Main product list --> {Products( before: '<ul>', helper: 'helpers/list-product', after: '</ul>' )} <!-- helpers/list-product.html --> <li> <a href="{ProductURL}"> <h3>{ProductName}</h3> {ProductImage} </a> {ProductAddToCart} {ProductBundles( before: ' <small><strong>The product belongs to the following product bundles:</strong></small> <ul> ', helper: 'helpers/product-bundle-list-item', after: '</ul>' )} </li> <!-- helpers/product-bundle-list-item.html --> <li> <a href="{BundleURL}"> <small>{BundleName}</small> </a> </li>The example's nested helper attributes would not actually work, but they should be placed in separate files.
Printing product details on a product bundle listing
In the example below, the product bundles including the products Amplifier, Guitar and 4x12 speaker will be printed as separate rows so that each row will display the product's and product bundles' names.
{Products( id: 1|2|3, helper: 'helpers/list-product', )} <!-- helpers/list-product.html --> {ProductBundles( helper: {{ {ProductName}: {BundleName} }} )}The example's nested helper attributes would not actually work, but they should be placed in separate files.
In such case, the following output would be produced:
Amplifier: Beginner Guitarist's Starter Pack
Amplifier: Noise Package
Guitar: Beginner Guitarist's Starter Pack
Guitar: Noise Package
4x12 Speaker: Noise Package
In the example, there are two product bundles in the online store with the following contents:
- Beginner Guitarist's Starter Pack (Amplifier, Guitar)
- Noise Package (Amplifier, Guitar, 4x12 Speaker)
Attribuutit
classes:Class names that are given to every list element.
Class names are printed using the
{BundleClass}tag in thehelperattribute of the tag. If the tag hasn't been used, the class names won't appear on the list.Allowed values: class names as strings.
Use space characters to separate the classes that are to be given to the same element. Use pipes to separate the classes that are to be given to different list elements.
E.g.
classes:'firstClass secondClass | everyOthersClass everyOthersSecondClass'type:Defines the list's output format if no additional markup has been defined in the
helperattribute.Allowed values:
- 'default': prints only the product bundles' names and links as a
<ul>list - 'normal': prints the product bundle's name and image on the list
- 'default': prints only the product bundles' names and links as a
helper:Defines the content and output format of a single list element.
Allowed values: the Interface and HTML markup that define the output's markup and content.
The
helperattribute can be used in two ways:- you can indicate the desired markup directly as the attribute's value, or
- you can indicate a reference to a file with the desired markup as the attribute's value. The reference should be indicated in relation to the theme's root directory.
See also detailed instructions on using the
helperattribute.before/after:With the
beforeandafterattributes, you can define content that is output before or after the content produced by the tag.Allowed values: text that may contain HTML and Interface markup.
E.g.
before:'<p>This markup appears before the tag's own content.</p>'.after:'<p>This appears after the tag's own content.</p>'
If the tag does not produce any content, the content of the
beforeandafterattributes will also not be displayed.escape:Adds an escape character before quotation marks in the output. The attribute makes it easier to process the tag-produced content when using JavaScript.
Allowed values: true/false. The default value is false.
or:Defines alternative content that is displayed if the tag itself does not produce any content.
Allowed values: text that may contain HTML and Interface markup.
E.g.
or:'Content not found.'
