Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product reviews... Question


SexFairy

Recommended Posts

Hello there:

I'm in the process of setting up my online store, and through testing it, I've realized that the reviews show my customers full name... Is there a way to change that so that it's initials only, or a nickname that the person can choose? My store is an adult store, therefore I assume that people won't want their full names on it. I don't want to miss out on product reviews because my customers would like to remain anonymous.

 

Thanks

The SexFairy ;)

Link to comment
Share on other sites

  • 2 weeks later...

In /catalog/reviews.php find this code:

 

				<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $reviews['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '"><u><b>' . $reviews['products_name'] . '</b></u></a> <span class="smallText">' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews['customers_name'])) . '</span>'; ?></td>

Replace with:

 

				<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $reviews['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '"><u><b>' . $reviews['products_name'] . '</b></u></a> <span class="smallText">' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected(substr( $reviews['customers_name'] , 0 , strpos( $reviews['customers_name'] , strchr( $reviews['customers_name'] , " " ) ) ))) . '</span>'; ?></td>

That should just output the first name only.

 

MAKE A BACKUP BEFORE MAKING ANY EDITS.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

  • 4 months later...
In /catalog/reviews.php find this code:

 

				<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $reviews['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '"><u><b>' . $reviews['products_name'] . '</b></u></a> <span class="smallText">' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews['customers_name'])) . '</span>'; ?></td>

Replace with:

 

				<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $reviews['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '"><u><b>' . $reviews['products_name'] . '</b></u></a> <span class="smallText">' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected(substr( $reviews['customers_name'] , 0 , strpos( $reviews['customers_name'] , strchr( $reviews['customers_name'] , " " ) ) ))) . '</span>'; ?></td>

That should just output the first name only.

 

MAKE A BACKUP BEFORE MAKING ANY EDITS.

I tried this but still got the full name. Is customers_name the correct one to use? I tried customers_firstname as a stab in the dark but that didn't work either.

Link to comment
Share on other sites

MY BAD!!!

:blush:

 

/catalog/product_reviews.php

 

Old code:

 

					<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $product_info['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '"><u><b>' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews['customers_name'])) . '</b></u></a>'; ?></td>

New code:

 

				<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $reviews['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '"><u><b>' . $reviews['products_name'] . '</b></u></a> <span class="smallText">' . sprintf(TEXT_REVIEW_BY,  substr( $reviews['customers_name'], 0 , strpos( $reviews['customers_name'], " ") ) ) . '</span>'; ?></td>

This works - I tried it.

;)

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

MY BAD!!!

:blush:

 

/catalog/product_reviews.php

 

Old code:

 

					<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $product_info['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '"><u><b>' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews['customers_name'])) . '</b></u></a>'; ?></td>

New code:

 

				<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $reviews['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '"><u><b>' . $reviews['products_name'] . '</b></u></a> <span class="smallText">' . sprintf(TEXT_REVIEW_BY,  substr( $reviews['customers_name'], 0 , strpos( $reviews['customers_name'], " ") ) ) . '</span>'; ?></td>

This works - I tried it.

;)

It's getting there. Displays first name only but does not link to full review.

Link to comment
Share on other sites

					<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $product_info['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '"><u><b>' . sprintf(TEXT_REVIEW_BY,  substr( $reviews['customers_name'], 0 , strpos( $reviews['customers_name'], " ") ) ) . '</b></u></a>'; ?></td>

Like Forrest Gump said, "Stupid is as stupid does".

 

Just call me stupid.

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

  • 1 month later...

Ok...I'm confused on all this... Which code do I look for and what do I replace it with again and in which file? LOL!

 

Also would you know why I'm getting the following error when dealing with Reviews? As soon as you write a review, and hit the Continue button, I get the following error:

 

Not Found

The requested URL /catalog/FILENAME_PRODUCT_REVIEWS was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

When you back out of the page, the review is listed. If you view it, and try using the Back button icon at the bottom of the review, I get the same error as well.

Link to comment
Share on other sites

  • 4 weeks later...
Ok...I'm confused on all this... Which code do I look for and what do I replace it with again and in which file?

 

 

I am also a bit confused after the above changes.

 

I could use a new post showing what to look for, and correct one to replace it with.

 

Thanks. ;-)

 

Though I have not yet installed the change, so I am not sure about any errors.

 

Waiting for a follow up before I try the code change.

Link to comment
Share on other sites

					<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $product_info['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '"><u><b>' . sprintf(TEXT_REVIEW_BY,  substr( $reviews['customers_name'], 0 , strpos( $reviews['customers_name'], " ") ) ) . '</b></u></a>'; ?></td>

Like Forrest Gump said, "Stupid is as stupid does".

 

Just call me stupid.

:blush:

 

 

This is the change that works. I tried it in my store while in development and again when the store went live. It displays the first name only.

Link to comment
Share on other sites

  • 2 weeks later...
This is the change that works. I tried it in my store while in development and again when the store went live. It displays the first name only.

 

I tried to follow all of the above, but still no joy.

 

I've added a customers_username column to my database, and customers have to supply a username when they join. I was hoping that if this code worked, I could alter it to display username instead.

 

Any ideas why after this code, reviews are still showing up with full names? Is it relevant that the testing user was a member BEFORE I made the change?

 

Thanks.

Link to comment
Share on other sites

Okay, so, I've been extremely stupid, and I have now seen the error of my ways...

 

 

Anyway, now I've got this doing what it's designed to do, how can I alter it to display the username instead of the customers first name...

 

Are there any PHP/MySQL academics out there with a nice simple solution, for a nice simple person such as myself?

Link to comment
Share on other sites

  • 1 year later...

					<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $product_info['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '"><u><b>' . sprintf(TEXT_REVIEW_BY,  substr( $reviews['customers_name'], 0 , strpos( $reviews['customers_name'], " ") ) ) . '</b></u></a>'; ?></td>

Like Forrest Gump said, "Stupid is as stupid does".

 

Just call me stupid.

:blush:

 

 

This worked for me - thank you, sir.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...