Here you can learn how to create product filters for product lists in MyCashflow themes.
Adding product filter support to a theme
How product filters impact product lists
When product filters are enabled in the online store and supported in the store theme, a number of attributes normally used for defining list contents become disabled for the {Products}
tag.
The contents of the lists that use product filters can be managed in the store settings.
The following attributes can still be used with the {Products}
tag even when product filters are enabled in the store:
type
list_type
list_classes
classes
helper
The {Products}
tag's aliases (e.g. {CategoryProducts}
, {DiscountProducts}
etc.) work as usual. These tags cannot be used with product filters.
Displaying product features on product pages
MyCashflow's in-built default theme Barebones includes in-built support for the feature.
You can set product features' values to be displayed on product pages by using the product filter Display as product feature on product pages setting.
In the product template, add the following markup to the location where you'd like to display product features:
{ProductFeatures(
helper: {{
{ProductAttributeValues(
before: {{ <p class="ProductAttribute-{ProductAttributeId}"> }},
after: {{ </p> }}
)}
}}
)}
See the individual parts of the example explained below:
- The
{ProductFeatures}
tag creates a list that contains the product's features. Thehelper
attribute defines how each feature should be displayed. - By default,
{ProductAttributeValues}
prints feature values as a comma-separated list.You can define the separator yourself by using the
separator
attribute or define the entire markup for each value by using thehelper
attribute. - For each feature, the
{ProductAttributeId}
tag adds a feature identifier, which is defined in the admin panel. This information can be used, for example, for writing CSS styles or scripts.