#32

Product support

Visit this product's website for support.

Categories

  • 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.

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

General information

Reviews for Shopaholic plugin allows clients to post reviews for products on your online shop or marketplace. Reviews provide customers with more insight as to the quality of the product and the level of satisfaction other customers had upon receiving the product. This important feature helps customers in making the final decision and serves as incentive to buy products, therefore increasing conversions.

The plugin extends Shopaholic’s functionality as follows:

  • Customers have the opportunity to review products and rate them (rating range can be set by the admin, for instance from 1 to 5 stars);
  • The overall product rating is generated as an average value based on all received reviews;
  • Before being posted on the website reviews go through moderation;
  • Allows to display a list of reviews for a product;
  • Allows to display the product’s overall rating;
  • Provides additional functionality to sort products by rating.

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

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

Developed by Andrey Kharanenka.

These plugin(s) are required for the plugin:

Review list

The full plugin documentation is abailable here.

Extension ProductItem class

Plugin adds fields:

"review" field in ProductItem object returns ReviewCollection object with sorted reviews for this product.

Example: render product reviews on product page

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

{# Get product item #}s
{% set obProduct = ProductPage.get() %}
<div data-id="{{ obProduct.id }}">
    <h1>{{ obProduct.name }}</h1>
   {# Render product rating #}
    <div>{{ obProduct.rating }}</div>
    {# Get list of reviews #}
    {% set obReviewList = obProduct.review %}
    {% if obReviewList.isNotEmpty() == true %}
        <ul>
            {% for obReview in obReviewList %}
            <li>{{ obReview.comment }}</li>
            {% endfor %}
        </ul>
    {% endif %}
</div>

MakeReview component

The component allows to create reviews.

Component properties:

  • Mode (Submit form/Ajax form)
  • Send flash message (only for Ajax mode)
  • Enable redirect
  • Choose page for redirect (the URL of the page will be passed to the review ID, product ID and product slug)

Usage: The component is used to process the review form. To send an ajax request, you must use the MakeReview::onCreate method. Available fields: name, email, phone, comment, rating.

Example 1 (Submit form).

[MakeReview]
mode = "submit"
redirect_on = 1
redirect_page = "review_success"
==

{% set arError = MakeReview.getErrorMessage %}
{% set arForm = MakeReview.getOldFormData %}

<form>
    <label for="field-email">Email</label>
    <input type="email" id="field-email" placeholder="Email" name="email" value="{{ arForm.email }}">
    {% if arError.message is not empty and arError.field == 'email' %}
        <p>{{ arError.message }}</p>
    {% endif %}

    <label for="field-comment">Comment</label>
    <textarea id="field-comment" name="comment">{{ arForm.comment }}</textarea>
    {% if arError.message is not empty and arError.field == 'comment' %}
        <p>{{ arError.message }}</p>
    {% endif %}

    <span>Rating:</label>
    <label><input type="radio" name="rating" value="1">1</label>
    <label><input type="radio" name="rating" value="2">2</label>
    <label><input type="radio" name="rating" value="3">3</label>
    <label><input type="radio" name="rating" value="4">4</label>
    <label><input type="radio" name="rating" value="5">5</label>

    <input type="hidden" name="product_id" value="10">
    <button type="submit">Submit</button>
</form>
{% if arError.message is not empty %}
    <p>{{ arError.message }}</p>
{% endif %}

Example 1 (Ajax request).

$('form').request('MakeReview::onCreate');

The MakeReview.getOldFormData method returns the filled form fields, if the form was sent and an error occurred. The MakeReview.getErrorMessage method returns an error message if the form was sent and an error occurred.

[
    'message' => 'Error message',
    'field'   => 'email',           //Field name, if there was a validation error
]

Plugin adds sorting by rating to ProductCollection class ('rating|desc', 'rating|asc').

Example: render of product list

Get collection of product, apply sorting by rating (desc), filter by flag "active" and category ID.

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

{% set obProductList = ProductList.make().sort('rating|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.1.1

Added check for isNested flag when expanding forms

Feb 23, 2018

1.1.0

Add "rating_data" field, add "getRatingCount", "getRatingTotalCount", "getRatingPercent" methods to ProductItem class

Feb 08, 2018

1.0.0

Initialize plugin.

Feb 04, 2018