Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Customer Reviews, their full name is diplayed?

Customer Reviews, their full name is diplayed?

Views: 21,075

Results 21 to 40 of 43
27 Oct 2010, 11:09 PM
#21
thomaswhiteeagle avatar

thomaswhiteeagle

New Zenner

Join Date:
May 2007
Posts:
93
Plugin Contributions:
0

Customer Reviews, their full name is diplayed?

Are you telling me that in order to use customer reviews (which is an integral part of running a good webstore I would think), that we have to go through and fiddle around with the core code and modify it as noted in the above posts so that the customers first and last name will not be displayed?

Really, I would have thunk that with privacy issues as they are nowadays that the core code would already have a customer review system that was a little more privacy friendly out of the box.
Just my musings on the subject..

7 Dec 2010, 8:48 PM
#22
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

Does anyone still read this post? I tried to add the changes, but it doesn't do what it says it's supposed to. The full name still shows up. I've been able to manipulate it a bit but now I've messed it up and it only shows: "."

Can anyone help? Thank you.

13 Dec 2010, 2:03 PM
#23
jasmel avatar

jasmel

Zen Follower

Join Date:
Feb 2008
Location:
Washington State
Posts:
230
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

Will this be part of a future release... say Zen-Cart 2.0? :cry:

12 Jan 2011, 1:16 AM
#24
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

Scott_C:

This will also need to be changed on the product display page itself (within the tpl_product_info_display.php). ill hunt around and post the change if I can.

I took at a look at tpl_product_info_display.php and that doesn't appear to be the file we want.

I believe the file we're looking for is : /templates/template_default/templates/tpl_product_reviews_default.php

I suspect the code to be edited can be found around line(s) 64 and/or 68. I just don't know which of those to edit, and how exactly to edit them.

The code is below. Does anyone want to take a crack at it?

Line 64:

<div class="productReviewsDefaultReviewer bold"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_short($reviews['dateAdded'])); ?> <?php echo sprintf(TEXT_REVIEW_BY, zen_output_string_protected($reviews['customersName'])); ?></div>
```Line 68:
```php
<div class="productReviewsDefaultProductMainContent content"><?php echo zen_break_string(zen_output_string_protected(stripslashes($reviews['reviewsText'])), 60, '-<br />') . ((strlen($reviews['reviewsText']) >= 100) ? '...' : ''); ?></div>
12 Jan 2011, 4:40 AM
#25
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Location:
Taiwan
Posts:
239
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

Scott_C:

Thanks to Richuno and Paul3648, Ive modified the code to truncate the last name on two of the reviews pages.

My solution (http://www.zen-cart.com/forum/showpost.php?p=909070&postcount=16) includes going into the the database and changing the name. Once that's done, the full name won't appear anywhere. It works for me, but I guess if you're getting several reviews a day you might want to automate everything.

12 Jan 2011, 4:52 PM
#26
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

paul3648:

My solution (http://www.zen-cart.com/forum/showpost.php?p=909070&postcount=16) includes going into the the database and changing the name. Once that's done, the full name won't appear anywhere. It works for me, but I guess if you're getting several reviews a day you might want to automate everything.

Hi Paul,

Thanks for your fast response! I did see where you had mentioned to go into the database and make a change there, but I didn't understand the "why" behind it and the effect it would have. Thanks for the clarification :smile:

I don't anticipate having so many reviews that doing this manually would be problematic, so that's what I will do for now.

But it sure would be nice to have it automated wouldn't it? One less thing to have to track :smile:

15 Jan 2011, 7:34 AM
#27
scott_c avatar

scott_c

Zen Follower

Join Date:
Dec 2009
Posts:
236
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

Hi Paul, thats a good idea, and certainly easier than having to edit multiple php files. The reason I sought to edit the php pages though was to try and circumvent a full name going into the db to begin with. I guess then the choice is to either edit all php pages required to stop previous names showing in full, or to run a script to clean up the names of reviewers who have already submitted.

I have a programmer who does a lot of work for me, I'll get him to look at it once he's finished with some other 'todo' items. When we've worked out a decent fix, I'll share it with everyone in this thread.> paul3648:

My solution (http://www.zen-cart.com/forum/showpost.php?p=909070&postcount=16) includes going into the the database and changing the name. Once that's done, the full name won't appear anywhere. It works for me, but I guess if you're getting several reviews a day you might want to automate everything.

19 Jan 2011, 8:21 PM
#28
iscatech avatar

iscatech

New Zenner

Join Date:
Mar 2009
Posts:
48
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

I'm confused with Paul3648's solution, I made the recommended change and it works on some pages, but not on the product info page (such as this one: LINK)

I realize now that I used dgReviews to display the review on the product page. Is it possible to remove the last name from this page as well?

Also, you guys mention editing the database, can you explain how to do that? Thank you!

20 Jan 2011, 6:02 AM
#29
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

iscatech:

I'm confused with Paul3648's solution, I made the recommended change and it works on some pages...

Three different people each submitted a solution, and each solution renders a result for a different page. In order to remove the last name from all of the pages, you have to implement all three of the solutions (if you want the process automated), or just implement both steps of Paul's solution (the second step is the database edit each time someone writes a review).

Those three solutions are:

richuno's solution affects individual Product Review Pages

Scott_C's solution affects the All Products Review Page

Paul3648's solution affects the Write a Review Page. However, if you also implement his suggested database edit, this will affect any page a product review appears on. But, it is a manual process, whereas the other edits automate the process. Unless you're having a ton of reviews, it's not that big of a deal to do manually until someone submits a fix for the final page where a last name is still appearing (All Reviews for a Single Product Page).

iscatech:

...but (the solutions don't work) on the product info page (such as this one: LINK). I realize now that I used dgReviews to display the review on the product page. Is it possible to remove the last name from this page as well?

Since you're using a Mod to create that, you'd have to talk to the Mod dev/author for a fix to it. But before you decide to keep this mod, you should be aware that this mod is four years and several ZC versions old and appears to be unsupported (due to the lack of updates)? If you really want to keep this old Mod, I strongly recommend using Paul's solution, because when you change the customer name in the review section of the database, it gets rid of it no matter where the review appears.

iscatech:

Also, you guys mention editing the database, can you explain how to do that? Thank you!

  1. Log in to your Cpanel
  2. Back Up Your Existing Database!!
  3. Go to phpMyAdmin
  4. Left Column shows list of your databases. Click on your ZC db
  5. Scroll left column to find zen_reviews & click it OR Scroll main window to find zen_reviews & click the browse icon
  6. You will see a list of customers who have written reviews.
  7. If there is only one, click the pencil icon to edit it
  8. If there is more than one, click "Check All" and then click the pencil icon to edit them
  9. To edit: Highlight and delete the last name, or all but the first letter of the last name, depending what you want to show on the pages.
  10. If editing only one, click the "go" button.
  11. If editing several, go to the bottom of the page and select "save" and "return to previous page" from the drop down options and then click the "go" button.
  12. You will need to repeat this db edit process every time a new review is posted until an automated fix is posted by some helpful user who knows what they're doing (i.e. not me <grin>).
    Hope that helps :)
20 May 2011, 11:34 PM
#30
louise_paisley avatar

louise_paisley

New Zenner

Join Date:
Apr 2011
Posts:
13
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

The final edit needed (I think) is in tpl_product_info_display.php

Change line 64(ish)..

<div class="productReviewsDefaultReviewer bold"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_short($reviews['dateAdded'])); ?> <?php echo sprintf(TEXT_REVIEW_BY, zen_output_string_protected($reviews['customersName'])); ?></div>

T0..

<div class="productReviewsDefaultReviewer bold"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_short($reviews['dateAdded'])); ?> <?php 
list($review_first_name, $review_last_name) = split(' ', zen_output_string_protected($reviews['customersName']));$last_name_array = str_split($review_last_name,1); echo sprintf(TEXT_REVIEW_BY, $review_first_name).' '.$last_name_array[0].'.'; ?></div>

If you make the change above and these three changes already given previousely..

richuno's solution
Scott_C's solution
Paul3648's solution

All review pages will have truncated surnames including the write review page.

The full name will still be entered into the database so I guess less than perfect but is not displayed anywhere on the cart front end unless other mods are displaying it.

For those using dgReviews there is one more change to truncate the surname on the product page..

find the following line in tpl_dgReveiw.php

 <div class="bold"><?php echo sprintf(TEXT_REVIEW_BY, zen_output_string_protected($reviews->fields['customers_name'])); ?></div>

and replace with..

 <div class="bold"><?php list($review_first_name, $review_last_name) = split(' ', zen_output_string_protected($reviews->fields['customers_name']));$last_name_array = str_split($review_last_name,1); echo sprintf(TEXT_REVIEW_BY, $review_first_name).' '.$last_name_array[0].'.'; ?></div> 

It took a while to get there, but I got there in the end :D

21 May 2011, 12:50 AM
#31
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

Good work Louise!

One thing though. I was not able to find this code:

<div class="productReviewsDefaultReviewer bold"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_short($reviews['dateAdded'])); ?> <?php echo sprintf(TEXT_REVIEW_BY, zen_output_string_protected($reviews['customersName'])); ?></div>

in the file tpl_product_info_display.php per your instructions.

However, I was able to find it in the file tpl_product_reviews_default.php located at: /templates/template_default/templates/tpl_product_reviews_default.php

So I copied it to MY_CUSTOM_TEMPLATE folder, made the change you suggested, and then tested it in my store. Works like a charm!

Louise-Paisley:

The final edit needed (I think) is in tpl_product_info_display.php

Change line 64(ish)..

<div class="productReviewsDefaultReviewer bold"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_short($reviews['dateAdded'])); ?> <?php echo sprintf(TEXT_REVIEW_BY, zen_output_string_protected($reviews['customersName'])); ?></div> ``` > > T0.. > > ``` <div class="productReviewsDefaultReviewer bold"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_short($reviews['dateAdded'])); ?> <?php list($review_first_name, $review_last_name) = split(' ', zen_output_string_protected($reviews['customersName']));$last_name_array = str_split($review_last_name,1); echo sprintf(TEXT_REVIEW_BY, $review_first_name).' '.$last_name_array[0].'.'; ?></div> ``` > > If you make the change above and these three changes already given previousely.. > > [richuno's solution](http://www.zen-cart.com/forum/showpost.php?p=809355&postcount=12) > [Scott\_C's solution](http://www.zen-cart.com/forum/showpost.php?p=942778&postcount=18) > [Paul3648's solution](http://www.zen-cart.com/forum/showpost.php?p=909070&postcount=16) > > All review pages will have truncated surnames including the write review page. > > The full name will still be entered into the database so I guess less than perfect but is not displayed anywhere on the cart front end unless other mods are displaying it. > > > For those using dgReviews there is one more change to truncate the surname on the product page.. > > find the following line in tpl_dgReveiw.php > > ``` <div class="bold"><?php echo sprintf(TEXT_REVIEW_BY, zen_output_string_protected($reviews->fields['customers_name'])); ?></div> ``` > > and replace with.. > > ``` <div class="bold"><?php list($review_first_name, $review_last_name) = split(' ', zen_output_string_protected($reviews->fields['customers_name']));$last_name_array = str_split($review_last_name,1); echo sprintf(TEXT_REVIEW_BY, $review_first_name).' '.$last_name_array[0].'.'; ?></div> ``` > > > It took a while to get there, but I got there in the end :D
20 Oct 2011, 9:49 AM
#32
caroliengibb avatar

caroliengibb

New Zenner

Join Date:
Aug 2011
Posts:
3
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

Thanks for this! I just swapped it and took out the name. Works perfect.

27 Nov 2011, 6:05 AM
#33
bearthings avatar

bearthings

New Zenner

Join Date:
Sep 2011
Posts:
2
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

For anyone looking for a way to omit a users full name from the reviews, there is an easier way. This method requires altering only 1 file and (as far as I can tell) works for all the various review pages.

In the file /includes/modules/pages/product_reviews_write/header_php.php - Find the following line:

$customer_query = "SELECT customers_firstname,  customers_lastname, customers_email_address
                   FROM " . TABLE_CUSTOMERS . "
                   WHERE customers_id = :customersID";

To use a customers full first name and last initial, replace the above code with the following:

$customer_query = "SELECT customers_firstname, LEFT(customers_lastname,1) AS customers_lastname, customers_email_address
                   FROM " . TABLE_CUSTOMERS . "
                   WHERE customers_id = :customersID";

To use just a customers initials for first and last names, use this instead:

$customer_query = "SELECT LEFT(customers_firstname,1) AS customers_firstname, LEFT(customers_lastname,1) AS customers_lastname, customers_email_address
                   FROM " . TABLE_CUSTOMERS . "
                   WHERE customers_id = :customersID";

This alters the SQL SELECT function for the reviews only. It leaves the customer data intact, but limits the data pulled for a review.

*I have tested this on my own sites, but user discretion is advised.

10 Jan 2012, 6:00 PM
#34
louisessweets avatar

louisessweets

New Zenner

Join Date:
Apr 2011
Posts:
9
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

BearThings:

For anyone looking for a way to omit a users full name from the reviews, there is an easier way. This method requires altering only 1 file and (as far as I can tell) works for all the various review pages.

In the file /includes/modules/pages/product_reviews_write/header_php.php - Find the following line:

$customer_query = "SELECT customers_firstname, customers_lastname, customers_email_address
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = :customersID";

> 
> To use a customers full first name and last initial, replace the above code with the following:
> ```php
$customer_query = "SELECT customers_firstname, LEFT(customers_lastname,1) AS customers_lastname, customers_email_address
                   FROM " . TABLE_CUSTOMERS . "
                   WHERE customers_id = :customersID";

To use just a customers initials for first and last names, use this instead:

$customer_query = "SELECT LEFT(customers_firstname,1) AS customers_firstname, LEFT(customers_lastname,1) AS customers_lastname, customers_email_address
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = :customersID";

> 
> This alters the SQL SELECT function for the reviews only. It leaves the customer data intact, but limits the data pulled for a review.
> 
> *I have tested this on my own sites, but user discretion is advised.
Thanks Bearthings.  This worked for me as well.
23 Mar 2012, 2:55 AM
#35
zekin avatar

zekin

New Zenner

Join Date:
Aug 2010
Posts:
33
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

This method really saves a lot of time. Works on mine.

Just want to remind anyone that, this method only effects the newly added review. So for all previous recorded review, reviewer's names are still FULL name.

BearThings:

For anyone looking for a way to omit a users full name from the reviews, there is an easier way. This method requires altering only 1 file and (as far as I can tell) works for all the various review pages.

In the file /includes/modules/pages/product_reviews_write/header_php.php - Find the following line:

$customer_query = "SELECT customers_firstname, customers_lastname, customers_email_address
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = :customersID";

> 
> To use a customers full first name and last initial, replace the above code with the following:
> ```php
$customer_query = "SELECT customers_firstname, LEFT(customers_lastname,1) AS customers_lastname, customers_email_address
                   FROM " . TABLE_CUSTOMERS . "
                   WHERE customers_id = :customersID";

To use just a customers initials for first and last names, use this instead:

$customer_query = "SELECT LEFT(customers_firstname,1) AS customers_firstname, LEFT(customers_lastname,1) AS customers_lastname, customers_email_address
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = :customersID";

> 
> This alters the SQL SELECT function for the reviews only. It leaves the customer data intact, but limits the data pulled for a review.
> 
> *I have tested this on my own sites, but user discretion is advised.
2 Apr 2012, 6:21 PM
#36
bearthings avatar

bearthings

New Zenner

Join Date:
Sep 2011
Posts:
2
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

zekin:

This method really saves a lot of time. Works on mine.

Just want to remind anyone that, this method only effects the newly added review. So for all previous recorded review, reviewer's names are still FULL name.

Thank you zekin, I forgot to mention that. The same method can be used for existing reviews, but there are several core php files that need to be modified in a similar fashion in addition to any review based add-ons. Either that or the reviews section of the database can be manually "massaged".

Bear

www.Bear-Things.com

19 May 2012, 6:34 PM
#37
skyguard2000 avatar

skyguard2000

New Zenner

Join Date:
Apr 2012
Posts:
4
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

Thank you, BearThings. This is the ultimate solution for the problem.

For those who are unfamiliar with MySQL syntax, in order to add a period after the initial of last name, you can use:

CONCAT(LEFT(customers_lastname,1),'.') AS customers_lastname

instead of

LEFT(customers_lastname,1) AS customers_lastname

in BearThings' snippet.

Just my 2 cents.

BearThings:

For anyone looking for a way to omit a users full name from the reviews, there is an easier way. This method requires altering only 1 file and (as far as I can tell) works for all the various review pages.

In the file /includes/modules/pages/product_reviews_write/header_php.php - Find the following line:

$customer_query = "SELECT customers_firstname, customers_lastname, customers_email_address
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = :customersID";

> 
> To use a customers full first name and last initial, replace the above code with the following:
> ```php
$customer_query = "SELECT customers_firstname, LEFT(customers_lastname,1) AS customers_lastname, customers_email_address
                   FROM " . TABLE_CUSTOMERS . "
                   WHERE customers_id = :customersID";

To use just a customers initials for first and last names, use this instead:

$customer_query = "SELECT LEFT(customers_firstname,1) AS customers_firstname, LEFT(customers_lastname,1) AS customers_lastname, customers_email_address
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = :customersID";

> 
> This alters the SQL SELECT function for the reviews only. It leaves the customer data intact, but limits the data pulled for a review.
> 
> *I have tested this on my own sites, but user discretion is advised.
10 Oct 2012, 4:13 AM
#38
miguel_t avatar

miguel_t

New Zenner

Join Date:
Jan 2010
Location:
Tucson, AZ, USA
Posts:
2
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

This worked great! Thank you very much! I have been trying to figure this out for a very long time now. My client will be very happy.

12 Jul 2013, 6:41 PM
#39
thomaswhiteeagle avatar

thomaswhiteeagle

New Zenner

Join Date:
May 2007
Posts:
93
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

BearThings:

For anyone looking for a way to omit a users full name from the reviews, there is an easier way. This method requires altering only 1 file and (as far as I can tell) works for all the various review pages.

In the file /includes/modules/pages/product_reviews_write/header_php.php - Find the following line:

$customer_query = "SELECT customers_firstname, customers_lastname, customers_email_address
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = :customersID";

> 
> To use a customers full first name and last initial, replace the above code with the following:
> ```php
$customer_query = "SELECT customers_firstname, LEFT(customers_lastname,1) AS customers_lastname, customers_email_address
                   FROM " . TABLE_CUSTOMERS . "
                   WHERE customers_id = :customersID";

To use just a customers initials for first and last names, use this instead:

$customer_query = "SELECT LEFT(customers_firstname,1) AS customers_firstname, LEFT(customers_lastname,1) AS customers_lastname, customers_email_address
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = :customersID";

> 
> This alters the SQL SELECT function for the reviews only. It leaves the customer data intact, but limits the data pulled for a review.
> 
> *I have tested this on my own sites, but user discretion is advised.

Am I missing something here? I followed this instruction to the letter (version 1.3.9f) and added a review and it is still showing first and last name for the review
12 Jul 2013, 6:55 PM
#40
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Location:
Taiwan
Posts:
239
Plugin Contributions:
0

Re: Customer Reviews, their full name is diplayed?

I am using CONCAT on 1.5. Works for me.

You might want to check that you are editing product_reviews_write - there are two other product_reviews folders.

$customer_query = "SELECT customers_firstname, CONCAT(LEFT(customers_lastname,1),'.') AS customers_lastname, customers_email_address
                   FROM " . TABLE_CUSTOMERS . "
                   WHERE customers_id = :customersID";