#10

Product support

Visit this product's website for support.

Categories

  • E-Commerce
  • Marketing

We have 100 coupons for those who want to test our paid plugins. Curious? Just let us know at [email protected]!

Live Demo

You can visit our Live Demo site. Sign in to backend using: login - manager, password - manager. You can deploy the demo site locally. To do so, you need to clone the repository, follow the steps from the "Installation guide", install the plugins. As a result, you will receive a copy of the demo site with a full database. Having a ready-made demo site example, you can easily learn how to operate the plugins.

Large Catalog Performance Live Demo

If you would like to know how our plugins perform with large catalogs of products, you can visit our Large Catalog Live Demo that has 21 000 products, 68 000 offers and 210 000 variations of property values.

Below are the performance characteristics for server setup: Dual Core CPU with 4GB of RAM.

For a catalog containing 210 products

Catalog page load time: 100-150 ms

Product list filtering time: 80-100 ms

For a catalog containing 21 000 products

Catalog page load time: 900-1100 ms

Product list filtering time: 500-600 ms

Support

Please join us on #shopaholic channel in October CMS slack chat in order to have quick support on all our products. You will also get all newest updates and insights about our existing and upcoming products!

If you have any specific requests, suggestions or ideas please do not hesitate to send us a message, it will help us make our products even better.

If you don't have access to octobercms.slack.com, please register here

Required Plugins

Recommended Plugins

General information

The Filter plugin adds functionality to Shopaholic, allowing you to create filters by brand and properties, including the properties provided by the Properties for Shopaholic plugin (if it’s installed).

With this plugin you can:

  • Create complex filters and display them through interactive interface components (checkboxes and radio buttons, sliders).
  • Add customizable filters by price that allow users to choose products of a certain price range from a minimum to a maximum amount.
  • Add custom filters like “Discounted products” or “Products in stock” that check if the products have discounts or if they are currently in store.
  • Choose which properties are to be included in a filter and customize it according to your individual needs.

Get involved and contribute to the project

If you’d like to help us improve the project, you can do so in the following ways:

You can also visit LOVATA’s GitHub page.

License

© 2018, LOVATA Software Development Company under GNU GPL v3.

Developed by Andrey Kharanenka.

These plugin(s) are required for the plugin:

Product properties for category

The full plugin documentation is abailable here.

FilterPanel component

Component allows you to render of custom filter panel for different site pages. For example: search results page, brand page with product list, etc.

Method list

getProductPropertyList($arPropertySetList, $obProductList = null)
  • (array|string) $arPropertySetList - array with list of property set codes
  • (ProductCollection) $obProductList - product collection. List of property values will be obtained for this product list.

Example: render of filter panel for product property set with code "main"

[FilterPanel]

[ProductList]
==

{# Get product list collection#}
{% set obProductList = ProductList.make().active() %}

{# Get products proeprty list for property sets with code 'main', enabled how filters #}
{% set obPropertyList = FilterPanel.getProductPropertyList(['main'], obProductList) %}

{% for obProperty in obPropertyList if obProperty.hasValue() %}

    {# Render filter name #}
    <div>{{ obProperty.filter_name }}</div>

    {# Get filter type #}
    {% set sFilterType = obProperty.filter_type %}

    {# Get proeprty value list #}
    {% set obPropertyValueList = obProperty.property_value.sort() %}

    {# Render filtre with type == checkbox #}
    {% if sFilterType == 'checkbox' %}
        {% for obValue in obPropertyValueList %}
            <input type="checkbox" value="{{ obValue.slug }}">
            <label>{{ obValue.value }}</label>
        {% endfor%}
    {% endif %}

    {# Render filtre with type == select #}
    {% if sFilterType == 'select' %}
        <select>
            {% for obValue in obPropertyValueList %}
                <option value="{{ obValue.slug }}">{{ obValue.value }}</option>
            {% endfor%}
        </select>
    {% endif %}
{% endfor %}
getOfferPropertyList($arPropertySetList, $obProductList = null)
  • (array|string) $arPropertySetList - array with list of property set codes
  • (ProductCollection) $obProductList - product collection. List of property values will be obtained for this product list.

Example: render of filter panel for offer property set with code "main"

[FilterPanel]

[ProductList]
==

{# Get product list collection#}
{% set obProductList = ProductList.make().active() %}

{# Get products proeprty list for property sets with code 'main', enabled how filters #}
{% set obPropertyList = FilterPanel.getOfferPropertyList(['main'], obProductList) %}

{% for obProperty in obPropertyList if obProperty.hasValue() %}

    {# Render filter name #}
    <div>{{ obProperty.filter_name }}</div>

    {# Get filter type #}
    {% set sFilterType = obProperty.filter_type %}

    {# Get proeprty value list #}
    {% set obPropertyValueList = obProperty.property_value.sort() %}

    {# Render filtre with type == checkbox #}
    {% if sFilterType == 'checkbox' %}
        {% for obValue in obPropertyValueList %}
            <input type="checkbox" value="{{ obValue.slug }}">
            <label>{{ obValue.value }}</label>
        {% endfor%}
    {% endif %}

    {# Render filtre with type == select #}
    {% if sFilterType == 'select' %}
        <select>
            {% for obValue in obPropertyValueList %}
                <option value="{{ obValue.slug }}">{{ obValue.value }}</option>
            {% endfor%}
        </select>
    {% endif %}
{% endfor %}

Extension CategoryItem class

Filter for Shopaholic plugin adds fields to CategoryItem class object:

"product_filter_property" and "offer_filter_property" fields in CategoryItem object returns FilterPropertyCollection object with sorted active properties for this category. Property collection object has elements with properties, enabled how filters. "product_filter_property" and "offer_filter_property" fields helps render filter panel by properties of products or offers.

Example: render of filter panel for category

[CategoryPage]
slug = "{{ :slug }}"
==

{# Get category item #}
{% set obCategory = CategoryPage.get() %}
<div data-id="{{ obCategory.id }}">
    <h1>{{ obCategory.name }}</h1>
    {# Get products proeprty list for category, enabled how filters #}
    {% set obPropertyList = obCategory.product_filter_property %}
    {% if obPropertyList.isNotEmpty == true %}
        {% for obProeprty in obPropertyList if obProeprty.hasValue() %}

            {# Render filter name #}
            <div>{{ obPropertyList.getFilterName(obProeprty.id) }}</div>

            {# Get filter type #}
            {% set sFilterType = obPropertyList.getFilterType(obProeprty.id) %}

            {# Get proeprty value list #}
            {% set obPropertyValueList = obProeprty.property_value.sort() %}

            {# Render filtre with type == checkbox #}
            {% if sFilterType == 'checkbox' %}
                {% for obValue in obPropertyValueList %}
                    <input type="checkbox" value="{{ obValue.slug }}">
                    <label>{{ obValue.value }}</label>
                {% endfor%}
            {% endif %}

            {# Render filtre with type == select #}
            {% if sFilterType == 'select' %}
                <select>
                    {% for obValue in obPropertyValueList %}
                        <option value="{{ obValue.slug }}">{{ obValue.value }}</option>
                    {% endfor%}
                </select>
            {% endif %}
        {% endfor %}
    {% endif %}
</div>

Extension ProductCollection class

Filter for Shopaholic plugin adds filtration methods to ProductCollection class:

filterByPrice($fStartPrice, $fStopPrice)

Method applies a filter by range of offer price from $fStartPrice to $fStopPrice. If $fStartPrice has empty value, then method applies a filter by range of offer price from 0 to $fStopPrice. If $fStopPrice has empty value, then method applies a filter by range of offer price from $fStartPrice. If $fStopPrice and $fStartPrice has empty value, then method isn't apply a filter by range of offer price.

    $obList = ProductCollection::make([1,2,10,15])->filterByPrice(10, 15);

filterByBrandList($arBrandIDList)

  • $arBrandIDList - array with brand ID's

Method applies a filter by list of brands.

    $obList = ProductCollection::make([1,2,10,15])->filterByBrandList([10, 15]);

filterByDiscount()

Method applies a filter and returns product list with offers that have a discount.

    $obList = ProductCollection::make([1,2,10,15])->filterByDiscount();

filterByQuantity()

Method applies a filter and returns product list with offers that have a quantity value > 0.

    $obList = ProductCollection::make([1,2,10,15])->filterByQuantity();

filterByProperty($arFilterList, $obPropertyList)

Method works only with Properties for Shopaholic plugin. Method applies a filter by product or offer properties.

You needs to prepare array $arFilterList in format:

    $arFilterList = [
        '12' => [ //Property ID
            'green', 'blue' //Array with values of properties for filtration
        ],
        15 => [
            10, 14 //Array with range of values (only for filter with type 'between')
        ],
    ];

You needs to get $obPropertyList object from current category item:

    //Apply filter by product properties
    $obCategory = CategoryItem.make(10);
    $obPropertyList = $obCategory.product_filter_property;

    $obList = ProductCollection::make([1,2,10,15])->filterByProperty($arFilterList, $obPropertyList);

    //.....

    //Apply filter by offer properties
    $obCategory = CategoryItem.make(10);
    $obPropertyList = $obCategory.offer_filter_property;

    $obList = ProductCollection::make([1,2,10,15])->filterByProperty($arFilterList, $obPropertyList);

Extension OfferCollection class

Filter for Shopaholic plugin adds filtration methods to OfferCollection class:

filterByPrice($fStartPrice, $fStopPrice)

Method applies a filter by range of price value from $fStartPrice to $fStopPrice. If $fStartPrice has empty value, then method applies a filter by range of price value from 0 to $fStopPrice. If $fStopPrice has empty value, then method applies a filter by range of price value from $fStartPrice. If $fStopPrice and $fStartPrice has empty value, then method isn't apply a filter by range of price value.

    $obList = OfferCollection::make([1,2,10,15])->filterByPrice(10, 15);

filterByProperty($arFilterList, $obPropertyList)

Method works only with Properties for Shopaholic plugin. Method applies a filter by offer properties.

You needs to prepare array $arFilterList in format:

    $arFilterList = [
        '12' => [ //Property ID
            'green', 'blue' //Array with values of properties for filtration
        ],
        15 => [
            10, 14 //Array with range of values (only for filter with type 'between')
        ],
    ];

You needs to get $obPropertyList object from current category item:

    $obCategory = CategoryItem.make(10);
    $obPropertyList = $obCategory.offer_filter_property;

    $obList = OfferCollection::make([1,2,10,15])->filterByProperty($arFilterList, $obPropertyList);

Extension PropertyValueItem class

isDisabled($obProductList)
  • (ProductCollection) $obProductList - filtered product collection The method returns true, if you apply filter with value == $this->slug, then filtered product collection will not be empty.
1.2.0

Add FilterPanel component for rendering custom filter panel. Improve performance. Added ability to create filter panel with mutually exclusive values of properties. Requires "Properties for Shopaholic" plugin version 1.3.0 and later.

Jul 11, 2018

1.1.0

Add FilterByDiscountStore, FilterByPropertyStore, FilterByQuantityStore classes. Requires Toolbox plugin version 1.10.0 and later.

Jun 21, 2018

1.0.0

Initialize plugin.

Dec 06, 2017