Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Remove last name on reviews


MagicalT

Recommended Posts

product_reviews.php puts the field "customers_name" into the review page. That's apparently the entire name. You would have to pull it out into a new variable and process it in some way, then use the variable in the output. It's tricky to isolate just the last name if it's given as one long string. If my name were Phil Van De Bogart, where would you cut off the "last" name? What might be more foolproof would be to change all words in the name to their first initial: P V D B. Some customers, when they write reviews, will be smart enough to realize that their name will be displayed and will anonymize it accordingly. Does the name used here come from the customer record or is it entered during the review? If it originally came from the customer record (purchase information), that's a violation of privacy to display it. I would think it sufficient to warn reviewers that whatever name they give will be printed with the review, so please just give their first name or initials if they want some privacy.

Link to comment
Share on other sites

You also try this:

 

Find this in product_reviews.php:

$reviews_query = tep_db_query($reviews_split->sql_query);
while ($reviews = tep_db_fetch_array($reviews_query)) {

 

Add this directly below:

 

//BOF use customers firstname only
$customers_name = explode(' ',$reviews['customers_name']);
$reviews['customers_name'] = $customers_name[0];
//EOF use customers firstname only

 

Please note this only changes what displays on the web page itself and doesnt alter the database at all.

Matt

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...