Filtering by Product Type
One of the many filtering options offered by Photoslurp’s widgets is the ability to filter content by the type of product or category to which the associated product belongs, which is often used on category pages. Depending on the situation this may be more convenient than the Collections functionality, as it does not require any additional tagging during content approval/media curation.
To use this feature, product categories must be correctly configured in your eCommerce platform and included in the product feed linked to the Photoslurp Catalog. If you are using one of our modules, or you’ve integrated using a Google product feed, the necessary data will already be available in the product_types column or in the <g_product_type> tag, respectively.
For more information about Product Types, please see this guide.
If you are using a custom product feed in a CSV file
An additional column called "product_types'' must be included and filled in with information on the category of each product. Category names can be a comma separated list of categories (Men, Shoes), a list with angular brackets to show hierarchy (Men > Shoes) or a combination of both ("Summer sales, Men > Swimwear", "BrandXYZ").
For more information on the requirements of a product feed in CSV format, please see this guide.
Implementing the code for Category widgets
To apply the "Product Types" filter to the widget, so that it only displays content from a specific category, the following Widget Configuration Code must be added to the widget page just before the point where the widget code itself is located:
<!-- Start Photoslurp Widget Configuration Code -->
<script>
window.photoSlurpWidgetSettings = window.photoSlurpWidgetSettings || {};
photoSlurpWidgetSettings["INSERT THE WIDGETID FOR THIS WIDGET"] = {
productType: ['men', 'shoes']
};
</script>
<!-- End Photoslurp Additional Parameters Code -->
Replace the widgetID and the example types (men and shoes) with the name(s) of the type(s) or category(ies) you wish to filter by. As explained above, this can be a comma-separated list or include a hierarchy with angle brackets. If you add more than one category, the widget will filter by products that include the specified product types, in no particular order.