Ausgirl Posted October 22, 2007 Share Posted October 22, 2007 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 More sharing options...
Gauravs Posted October 22, 2007 Share Posted October 22, 2007 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 More sharing options...
Ausgirl Posted October 22, 2007 Author Share Posted October 22, 2007 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 More sharing options...
Nullachtfuffzehn Posted October 23, 2007 Share Posted October 23, 2007 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 More sharing options...
Ausgirl Posted October 23, 2007 Author Share Posted October 23, 2007 Thanks Manfred, That did the trick, is there a way it could add the customers State next to their name? Like this: Joanne NSW Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.