#90

Product support

Visit this product's website for support.

Categories

  • Marketing

The Popularity for Shopaholic plugin adds functionality to Shopaholic plugin, allowing to calculate the popularity of products. Product popularity is calculated based on how many times the product is viewed, the times it’s added to cart and ultimately the times it has been actually bought.

This plugin also extends the functionality of the Shopaholic plugin, allowing users to sort products by popularity.

Get involved and contribute to the project

If you're interested in improving this project you can help in the following ways:

  • Reporting bugs and recommending new features on our plugin GitHub issues page; Contributing to the project following these instructions;

License

© 2017, LOVATA Group, LLC under GNU GPL v3.

Developed by Andrey Kharanenka.

These plugin(s) are required for the plugin:

Plugin adds field 'popularity' to Product model.

Plugin adds sorting by popularity to ProductCollection class.

Example: render of product list

Get collection of product, apply sorting by popularity, filter by flag "active" and category ID.

{% set obCategory = CategoryPage.get() %}

{% set obProductList = ProductList.make().sort('popularity|desc').active().category(obCategory.id) %}
{% if obProductList.isNotEmpty() %}
    <div class="product-list-wrapper">
        {% for obProduct in obProductList %}
            <div data-id="{{ obProduct.id }}">
                <h1>{{ obProduct.name }}</h1>
                {% if obProduct.preview_image is not empty %}
                    <img src="{{ obProduct.preview_image.path }}" title="{{ obProduct.preview_image.title }}" alt="{{ obProduct.preview_image.alt }}">
                {% endif %}
                <div>{{ obProduct.preview_text }}</div>
            </div>
        {% endfor %}
    </div>
{% endif %}
1.0.0

Initialize plugin.

Dec 07, 2017