Texnical description
Interfaces
User interface
A specific area is dedicated to the comments, placed at the bottom of each product page (widget area « productdetails_bottom »).
It contents :
- A title, showing the name of the product : « product name – product reviews »
- A form which will allow to write a new comment
- The list of all existing comments, from the newest to the oldest.
Product review form
The new comment form is folded, reachable by clicking on a link: « Be the first to review this product »: if there’s no opinion written yet, « Add your review »: if there’s at least 1 existing opinion.
An anchor is set up.
If the user is logged in, the activation of the link unfold the form.
Otherwise, the user is redirected to the login/register page and then to the anchor described above.
The form allows users to write a title (100 characters max), a text (1000 characters max) and a score (of 1 to 5).
The form is protected by a captcha based on the specific parameter set up in the admin interface.
The form validation induces:
- Storing informations in current language
- The asynchronous calls to the web service (Google Translate) for the translation of the title and text in all installed languages ("- translated by Google" is added to the translation of texts) according to the storage instructions above, and the refresh of the current page.
Product review display
Comments is displayed from the newest to the oldest applying model and features (comments scoring) proposed by default by nopCommerce.
The displayed title and text versions will be the ones corresponding to the current language.
A link allowng to display the original version is proposed for comments which haven’t been written in the current language. E.g.: «Read the original version (spanish)».
The original version is displayed using an Ajax filed div, in order to make contents not appear in the HTML code.
Only the 10 latest comments are visible, the other ones are in a folded div which makes them displayed by clicking on a « See all comments » link.
Every review contains an "Inappropriate Content" link leading to a form letting enter a text of complaint and the email address of the applicant (required and verified by a regular expression).
The form shows the IP address of the HTTP client and the time and date of the request.
A successful validation leads the user to a confirmation page.
A confirmation message, containing the text of the complaint, the URL of the product page, the original title and text of the review, the IP address and the time and date of the request, is sent to the user's email address. A blind copy is simultaneously sent to the address specified in the plugin configuration page (see bellow).
Productreview page
Page /productreviews/{n} is changed to redirect the user toward the anchor placed next to the form to write a new comment.
If the user isn’t logged in, he or she will be redirected toward the register/login page before being redirected.
Administration interface
The comment moderation interface is changed to allow an access to the different versions of the title and text thanks to the tab system commonly used in the whole admin interface.
Configuration interface
The configuration page of the plugin lets specify:
- the Google translate API key.
- the nopCommerce email account sending the confirmation email
- the email address receiving the complaint confirmation message in blind copy
Storage
Reviews storage is patterned based on the other textual multilingual resources, ie:
- Use of Title and ReviewText fields in the ProductReview table for the english version
- Storage and retrieval of the following records in the LocalizedProperty table:
- LocaleKeyGroup "ProductReview" LocaleKey: "Title"; LocalValue: title
- LocaleKeyGroup "ProductReview" LocaleKey "ReviewText" LocalValue: text
for other installed languages.