thelia / comment-module
Installs: 553
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 9
Forks: 9
Open Issues: 3
Type:thelia-module
Requires
- thelia/installer: ~1.1
README
The module Comment allows customer to add comments on different elements of the website : product, content, ...
A comment is composed of a :
- title
- message
- rating
- is related to a customer
The message can be moderated by a administrator before being displayed on the website (recommended).
Only registered and logged in customer can post comment on the website. You can also only authorized customers to post comment on products that they have bought. Customers will receive an email after 15 days (by default) to encourage them to post comment.
If the comment has been accepted the customer can edit or delete it.
This module is compatible with Thelia version 2.1 or greater.
Installation
Manually
- Copy the module into
<thelia_root>/local/modules/
directory and be sure that the name of the module is Comment. - Activate it in your thelia administration panel
Composer
Add it in your main thelia composer.json file
composer require thelia/comment-module ~1.3.0
Usage
In back-office, the configuration page allows you to configure the module.
In the tools menu, a new page displays comments and let you manage them.
In the front office, an integration is provided for the default template. It uses hooks, so it's activated by default.
You can override these smarty templates in the current template. You have to put your templates files in this directory
(with default template) : template/frontOffice/default/modules/Comment/
Loop
The module provides a new loop : comment
Input arguments
Output arguments
how to get the rating of a product
Ratings are stored in the meta_data table. to retrieve the rating, you can use the smarty function meta
like this :
{$rating={meta meta="COMMENT_RATING" key="product" id="10"}} {if $rating} <span class="pull-right"> rating: {$rating} </span> {/if}