Forums / General Questions / What shows in a customer review?

What shows in a customer review?

Views: 14,125

Results 41 to 48 of 48
27 Oct 2009, 4:42 PM
#41
jabtac avatar

jabtac

New Zenner

Join Date:
Jun 2009
Posts:
17
Plugin Contributions:
0

What shows in a customer review?

GambitJoe:

I did this as follows....

  1. Modify the following file:
    /includes/modules/pages/product_reviews_write/header_php

  2. Add a query to pull the city

// customer entry query added
$customer_city_query = "SELECT entry_city FROM " . TABLE_ADDRESS_BOOK . " WHERE customers_id = :customersID LIMIT 1";
$customer_city_query = $db->bindVars($customer_city_query, ':customersID', $_SESSION['customer_id'], 'integer');
$customer_city = $db->Execute($customer_city_query);

  1. Modify this:
    $sql = $db->bindVars($sql, ':customersName', $customer->fields['customers_firstname'] . ' ' . $customer->fields['customer_lastname'], 'string');

to:

$sql = $db->bindVars($sql, ':customersName', $customer->fields['customers_firstname'] . ' from ' . $customer_city->fields['entry_city'], 'string');

This worked for me...hopefully it works for you.

That worked great for me, thank you for your input!

Just a note: At the page where the customer inputs the review, it says "Written By:" and has the full customer first and last name, but when they click to update the review, it doesn't list their whole name, it lists just the First Name and City like it should after your modifications.

30 Oct 2009, 3:23 PM
#42
jabtac avatar

jabtac

New Zenner

Join Date:
Jun 2009
Posts:
17
Plugin Contributions:
0

Re: What shows in a customer review?

jabtac:

Just a note: At the page where the customer inputs the review, it says "Written By:" and has the full customer first and last name, but when they click to update the review, it doesn't list their whole name, it lists just the First Name and City like it should after your modifications.

Okay, I fixed this if anyone is interested. Now the Write a Review Page that the customer sees will say "Written By: Customer's name from Customer's City".

Here's the quick fix -

Open this file for editing:
/includes/templates/YOUR_TEMPLATE/templates/tpl_product_reviews_write_default.php

Around Line 41, change this line

<h3 id="reviewsWriteReviewer" class=""><?php echo SUB_TITLE_FROM, zen_output_string_protected($customer->fields['customers_firstname'] . ' ' . $customer->fields['customers_lastname']); ?></h3>

To this:

<h3 id="reviewsWriteReviewer" class=""><?php echo SUB_TITLE_FROM, zen_output_string_protected($customer->fields['customers_firstname'] . ' from ' . $customer_city->fields['entry_city']); ?></h3>
16 Nov 2009, 5:18 PM
#43
tapper avatar

tapper

Zen Follower

Join Date:
Nov 2007
Location:
Upstate NY
Posts:
233
Plugin Contributions:
0

Re: What shows in a customer review?

This is a great thread! Thanks

I'd like to change this line so it only shows the initials.

$sql = $db->bindVars($sql, ':customersName', $customer->fields['customers_firstname'] . ' ' . $customer->fields['customers_lastname'], 'string');

Would something like this work?
LEFT(1,$customer->fields['customers_firstname'] ). ' ' . LEFT(1,$customer->fields['customers_lastname']), 'string');

Or, where would I insert the LEFT statement? Or should it be SUBSTR?

24 Nov 2009, 1:38 PM
#44
ningyotan avatar

ningyotan

New Zenner

Join Date:
Nov 2009
Posts:
56
Plugin Contributions:
0

Re: What shows in a customer review?

LittleOleMeDesigns:

Look back at post #3 where Linda tells you where to find the file to modify and the line of code to change... and then remove this part..

customers_lastname

taking care to leave the single quotation marks in there

if I ever figure out that city thing in place of the last name, i'll put that in here too:blink:

Legend, thanks!!!

athena:

The reviews take the first and last name in the main customer table in your database and put them together in the reviews table in your database. So any reviews already compiled are set. The only way to eliminate the last name in the existing reviews is to physically go into your reviews table in your database and delete the last name in that column, leaving the first name intact.

If you are not used to going into the database or do not have a tool to do that, search the forum here for database editing advice. It is pretty scary, but can be done safely. You can't be reckless about it.

Did some searches here and on google with the words "database editing" but couldn't find a thread with instructions on how to do it.

I'm game enough to jump in there and play as I would like to remove the customer surname from the existing reviews.

5 Oct 2010, 8:20 PM
#45
atl2rva avatar

atl2rva

New Zenner

Join Date:
Feb 2010
Posts:
81
Plugin Contributions:
0

Re: What shows in a customer review?

I was curious if there was a way to replace the customers last name with their customer ID. I was able to get it to show just the customer ID by changing the line in /includes/modules/pages/product_reviews_write/header_php.php to...

$sql = $db->bindVars($sql, ':customersName', $_SESSION['customer_id'], 'integer');

...but I have not been able to make it display the first name followed by the customer ID. I think it has to do with the integer/string. I am a bit lost when it comes to coding. Generally I just start experimenting (after backing up) and hope for the best. :P

6 Oct 2010, 11:58 AM
#46
addlabels avatar

addlabels

New Zenner

Join Date:
Oct 2010
Location:
USA
Posts:
1
Plugin Contributions:
0

Re: What shows in a customer review?

I have taken Linda's Code. I got rid of the last name.

8 Dec 2010, 9:49 PM
#47
joyjoy avatar

joyjoy

Totally Zenned

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

Re: What shows in a customer review?

Ajeh:

You would need to customize the:
/includes/modules/pages/product_reviews_write/header_php.php

you need to change the line:

$sql = $db->bindVars($sql, ':customersName', $customer->fields['customers_firstname'] . ' ' . $customer->fields['customers_lastname'], 'string');
> 
> to what you want stored in the reviews table ...

Would this still work? What would I change to have only the first name visible? Thank you.
9 Apr 2011, 5:42 PM
#48
zcadqliv avatar

zcadqliv

New Zenner

Join Date:
Jan 2011
Posts:
69
Plugin Contributions:
0

Re: What shows in a customer review?

GambitJoe:

I did this as follows....

  1. Modify the following file:
    /includes/modules/pages/product_reviews_write/header_php

  2. Add a query to pull the city

// customer entry query added
$customer_city_query = "SELECT entry_city FROM " . TABLE_ADDRESS_BOOK . " WHERE customers_id = :customersID LIMIT 1";
$customer_city_query = $db->bindVars($customer_city_query, ':customersID', $_SESSION['customer_id'], 'integer');
$customer_city = $db->Execute($customer_city_query);

  1. Modify this:
    $sql = $db->bindVars($sql, ':customersName', $customer->fields['customers_firstname'] . ' ' . $customer->fields['customer_lastname'], 'string');

to:

$sql = $db->bindVars($sql, ':customersName', $customer->fields['customers_firstname'] . ' from ' . $customer_city->fields['entry_city'], 'string');

This worked for me...hopefully it works for you.

This did work for me! But I want to change the city to the state. I tried replacing "city" with "state" and "state/province" to no avail. Any ideas.