Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to remove last name from product reviews?


Ausgirl

Recommended Posts

Hello,

 

How do I remove the last name from showing in product reviews. (People dont like their last name advertised on the net, & it prevents them from leaving a review)

 

I just want their first name and State to show like this:

 

by Joanne NSW

 

Much appreciated

 

:)

Link to comment
Share on other sites

Use php function explode and print first array element (for first name)

demo code

$names = explode(" ", $first&lastname);
echo $names[0];

 

$first&lastname=John Doe

$names becomes array and stores values as elements in an array, so

$names[0] would give you first name, and

$names[1] would give you last name.

 

 

HTH,

 

thx

GS

Best Regards,
Gaurav

Link to comment
Share on other sites

Gaurav,

 

Im not sure what it is your saying. If you are saying I have code like that I need to change, I cant find any code that looks similar to that. If your telling me to place that code into my catalog/reviews.php where do I place it?

 

Thanks

Link to comment
Share on other sites

You got to edit your /catalog/products_review_write.php and search for the following (around line 47):

 

	if ($error == false) {
  tep_db_query("insert into " . TABLE_REVIEWS . " (products_id, customers_id, customers_name, reviews_rating, date_added) values ('" . (int)$HTTP_GET_VARS['products_id'] . "', '" . (int)$customer_id . "', '" . tep_db_input($customer['customers_firstname']) . ' ' . tep_db_input($customer['customers_lastname']) . "', '" . tep_db_input($rating) . "', now())");

 

and replace it with the following

 

	if ($error == false) {
  tep_db_query("insert into " . TABLE_REVIEWS . " (products_id, customers_id, customers_name, reviews_rating, date_added) values ('" . (int)$HTTP_GET_VARS['products_id'] . "', '" . (int)$customer_id . "', '" . tep_db_input($customer['customers_firstname'])  . "', '" . tep_db_input($rating) . "', now())");

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...