Product Filtration by Attributes
Zid Merchants can enhance the shopping experience by offering product filtration based on specific attributes. As a theme developer, integrating this feature effectively into the theme is crucial for enabling customers to easily find and select products based on their preferences.
Activation Steps for Merchants
- Merchants can add product filtration attributes from their dashboard at: Zid Product Filtration Settings.
- After setting up filtration attributes, merchants assign appropriate attributes to each product.
- On the customer end, these assigned attributes are displayed, allowing customers to filter products based on these attributes.
Code Snippet Integration for Theme Partners
This code snippet demonstrates how to integrate the product filtration system in your theme. It checks for the existence of product filters and conditionally includes templates for displaying and filtering products based on assigned attributes.
<div class="container d-flex flex-row">
{% if products.filters|length > 0 %}
{% include 'template_for_products_attributes' with { 'async' : true } %}
{% endif %}
<div class="products-container flex-grow-1 pt-4">
<div>
{% include 'products-filter.twig' with
{ 'count' : products.total, 'has_products_filtration':
( products.filters|length > 0)
}
%}
</div>
<div id="products-list" class="row products-list">
{% for product in products.data %}
<div class="prod-col
{% if products.filters|length > 0 %}
prod-col-attr
{% endif %}
prod-col-tb">
{% include 'product-card.twig' with
{'product' : product, 'index': key}
%}
</div>
{% endfor %}
</div>
</div>
</div>
Last modified: 2 months ago