GithubHelp home page GithubHelp logo

roadster31 / comment Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thelia-modules/comment

0.0 1.0 0.0 156 KB

Comment system for customers

License: GNU Lesser General Public License v3.0

PHP 78.74% JavaScript 8.80% HTML 12.17% CSS 0.28%

comment's Introduction

Module Comment

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

Argument Description
id the comment id
customer the customer id
ref the reference key. eg : product
ref_id the reference id. (the product id)
status the status of the comment : 0 = pending, 1 = accepted
verified the customer has bought the product
locale the locale of the comment : fr_FR
load_ref load or not the reference object. default = 0
ref_locale locale of the reference object fields. default: the request locale

Output arguments

Variable Description
$ID the comment id
$USERNAME the username
$EMAIL the email
$CUSTOMER_ID the customer id
$REF the reference key
$REF_ID the reference id
$TITLE the title
$CONTENT the content
$RATING the rating
$STATUS the status : : 0 = pending, 1 = accepted
$VERIFIED 0 : not verified / not applicable, 1 = the customer has bought the product
$ABUSE an abuse counter.

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}

comment's People

Contributors

bcbrr avatar bibich avatar kira-kyuukyoku avatar lunika avatar mespeche avatar zzuutt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.