Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Variable for first name?


ActiveTuning

Recommended Posts

Is there any way I can change the review format to show a customers first name? Or even first name and last name initial. It's a privacy concern for some customers to list their full name. This is what the code is now:

 

<?php echo '<b>' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($review['customers_name'])) . '</b>'; ?>

Link to comment
Share on other sites

This answer does exist somewhere in this forum!

 

I know because I found it a long time ago but sadly can no longer remember how it was done. I changed to first name and town as I agree surnames are just wrong.

 

Try a google search as that is how I would have found it.

Link to comment
Share on other sites

Okay have searched around my docs and found the following:

 

Its the product_reviews_write.php you have to modify. There is an sql line there (line-27) that pulls out the customers first and last names. Modify it to pull out the columns you want. Then when the form is processed (action - few lines down) it inserts the entry by appending and setting the customer colums as customer's name. Just use the columns you pulled out from the first query (line-48).

 

Think I must have done a lot of digging at the time to make sense of it all but don't remember it being very complicated. Those mods tend to stick in my mind :rolleyes:

Link to comment
Share on other sites

Okay have searched around my docs and found the following:

 

Its the product_reviews_write.php you have to modify. There is an sql line there (line-27) that pulls out the customers first and last names. Modify it to pull out the columns you want. Then when the form is processed (action - few lines down) it inserts the entry by appending and setting the customer colums as customer's name. Just use the columns you pulled out from the first query (line-48).

 

Think I must have done a lot of digging at the time to make sense of it all but don't remember it being very complicated. Those mods tend to stick in my mind :rolleyes:

What about previous reviews? Is the easiest way just to go in and change it at the database-level?

Link to comment
Share on other sites

Awesome, worked perfectly. This is the line:

 

$customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");

 

Remove ",customers_lastname"

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...