randynchicago Posted January 30, 2006 Posted January 30, 2006 When viewing reviews written by customers, I would like their FIRST NAME ONLY to display instead of their full name. This has to be an easy change in a php file...anyone familiar with how to do this? Thanks for the help!! Randy Sorry, I posted a question here...Now I can't find a way to delete the post!!
kgt Posted January 30, 2006 Posted January 30, 2006 Change line 48 in product_reviews_write.php: 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())"); to 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())"); This will not edit data that already exists, so if you have existing reviews, you'll need to remove the last name from all the records. Contributions Discount Coupon Codes Donations
Guest Posted February 10, 2006 Posted February 10, 2006 Change line 48 in product_reviews_write.php: 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())"); to 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())"); This will not edit data that already exists, so if you have existing reviews, you'll need to remove the last name from all the records. Thank you kgt, this was useful also for me!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.