View
214
Download
0
Category
Preview:
Citation preview
Lecture#09
Outline
Empowers to your customer Product Rating and its Management
in Ecommerce Framework Product Reviews and Management:
Collecting customer opinion about a product
Giving Power to Customer
There are two most famous ways to empower customer Product Rating Product Reviews
Product Rating is a process of assigning a value to a product Show your likeness and dislikenes Limited to set of values (usually 1-5)
Product Rating
Product Rating is simple to add in framework Show rating options to customer on each
product▪ Radio buttons, stars etc.▪ Values ranges from 1 to 5
Customer selects one and only one value
Selected values are recorded in table Average of recorded values is calculated Show average value to customer on
product page
Can a customer rate a product multiple
times?
Can an anonymous customer rate a
product?
Product Rating
For Registered customers When they give rating Values are saved in table against their
CustomerID Average rating is updated and displayed on
product page For Anonymous customers
When they give rating to a product Values are saved in table against IP and
Session (Like wish list) Average rating is updated on product page
How to save their
rating?
Product Rating -Model
We need a table in database with columns ID (Integer, Primary Key, Auto Increment) ,
ContentID (Integer), Rating (Integer) , User ID (Integer), Timestamp (datetime), Session ID(Varchar), IP Address (Varchar)
Product Rating-Controller Controller will perform the following
task When customer click for rating Pass rated value (bw 1-5) to url Parse the URL and extract the information▪ User Identity, Product ID and Rated Value etc.
Check product is valid Check rated value is valid Check user identity▪ If logged in, get UserID from user table▪ If anonymous, get IP address and timestamp
Product Rating-Controller
Check current customer has already rated the current product▪ If yes, ignore further processing▪ If no, save information in Rating Table
Calculate average with new values Redirect user to rated product page
Product Rating-View
To display rating of product we have to use following query
It is a sub query for rating within main query for product information
Product Reviews
Product Reviews are customers opinion, feedback, likeness or dislikes about product
A simple feed back form on product page with: Customer name, email, feedback as well
Reviews can be displayed on product page simple as on blogs or comments
Product Review-Model
We needs a Review table with following columns in DB to store customer reviews
Product Review-Model
SQL statement to create content_comments
SQL statement to maintain referential integrity
Product Reiview
A simple process of product review can be: Along with table in DB, we need to provide a
form to customer for getting review Customer will fill the form and click on submit
button Form values are processed and saved in DB Review is pending for Admin approval After Admin approval, Review is displayed on
product page If admin rejects, Review is deleted from DB and
not displayed on product page
Product Revew
Simple Product Review form can be:
Product Review-Controller Controller will perform the following
actions Get the data from form after its submission Validate the form data Check if customer is logged in▪ Save data with customer logged in information
If not logged in▪ Save reviews with IP and timestamp
Redirect/move customer on product page after adding review
After approval from admin▪ Show review on product page
Product Reivew-View
What do we need to do to display reviews and comments?1. Check to see if there are any comments2. Display either the comments or a "no
comments" template3. Check to see if new comments are allowed4. Display either the comments form or a "no
comments allowed" template Displaying and approving reviews are
part of admin controller
Recommended