Thank you, BearThings. This is the ultimate solution for the problem.
For those who are unfamiliar with MySQL syntax, in order to add a period after the initial of last name, you can use:
CONCAT(LEFT(customers_lastname,1),'.') AS customers_lastname
instead of
LEFT(customers_lastname,1) AS customers_lastname
in BearThings' snippet.
Just my 2 cents.
BearThings:
For anyone looking for a way to omit a users full name from the reviews, there is an easier way. This method requires altering only 1 file and (as far as I can tell) works for all the various review pages.
In the file /includes/modules/pages/product_reviews_write/header_php.php - Find the following line:
$customer_query = "SELECT customers_firstname, customers_lastname, customers_email_address
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = :customersID";
>
> To use a customers full first name and last initial, replace the above code with the following:
> ```php
$customer_query = "SELECT customers_firstname, LEFT(customers_lastname,1) AS customers_lastname, customers_email_address
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = :customersID";
To use just a customers initials for first and last names, use this instead:
$customer_query = "SELECT LEFT(customers_firstname,1) AS customers_firstname, LEFT(customers_lastname,1) AS customers_lastname, customers_email_address
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = :customersID";
>
> This alters the SQL SELECT function for the reviews only. It leaves the customer data intact, but limits the data pulled for a review.
>
> *I have tested this on my own sites, but user discretion is advised.