Lesli,
Any chance you feel like elaborating?
Lesli,
Any chance you feel like elaborating?
If you must smoke, please do so electronically.
My solution was to split the reviewer's name into first and last name, then truncate the last name to the first letter.
copy template_default/templates/tpl_product_reviews_info_default.php to YOUR_TEMPLATE/templates/
then replace:
<div id="reviewsInfoDefaultMainContent" class="content"><?php echo zen_break_string(nl2br(zen_output_string_protected(stripslashes($review_info->fields['reviews_text']))), 60, '-<br />'); ?></div>
<div id="reviewsInfoDefaultDate" class="bold"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_short($review_info->fields['date_added'])); ?> <?php echo sprintf(TEXT_REVIEW_BY, zen_output_string_protected($review_info->fields['customers_name'])); ?></div>
with:
<div id="reviewsInfoDefaultMainContent" class="content"><?php echo zen_break_string(nl2br(zen_output_string_protected(stripslashes($review_info->fields['reviews_text']))), 60, '-<br />'); ?></div>
<div id="reviewsInfoDefaultDate" class="bold"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_short($review_info->fields['date_added'])); ?> <?php
list($review_first_name, $review_last_name) = split(' ', zen_output_string_protected($review_info->fields['customers_name']));
$last_name_array = str_split($review_last_name,1);
echo sprintf(TEXT_REVIEW_BY, $review_first_name).' '.$last_name_array[0].'.'; ?></div>
[I selected the entire div to make the section easier to find]
it changes the review information from "by John Smith" to "by John S."
Hope it helps
I have successfully been able to remove the first and last name, but how do I remove the word "by". For example, once customers post a review it now reads:
Date Added: 01/14/2010 by
Where do I remove the "by" word? Any help would be appreciated. Thank you,
Miguel
Thanks Richuno, worked like a charm!
I tweked "lightly" the richuno´s code for showing first letter of the two lastnames for languages like spanish, with FIRSTNAME LASTNAME LASTNAME:
Hope this helps !!Code:<div id="reviewsInfoDefaultDate" class="bold"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_short($review_info->fields['date_added'])); ?> <?php list($review_first_name, $review_last_name1, $review_last_name2) = split(' ', zen_output_string_protected($review_info->fields['customers_name'])); $last_name_array1 = str_split($review_last_name1,1); $last_name_array2 = str_split($review_last_name2,1); echo sprintf(TEXT_REVIEW_BY, $review_first_name).' '.$last_name_array1[0].'. '.$last_name_array2[0].' '; ?></div>
The patches above all have the same problem: when the customer goes to write a review, the page has a big heading - "Written by Joe Blow"
So any customer who does not want his full name used on a review will be scared off by seeing his full name.
There's a simple solution - /includes/templates/template_default/templates/tpl_product_reviews_write_default.php
Copy this file to your template folder i.e. /includes/templates/YOUR_TEMPLATE/templates/tpl_product_reviews_write_default.php
About line 40 - change this line:
<h3 id="reviewsWriteReviewer" class=""><?php echo SUB_TITLE_FROM, zen_output_string_protected($customer->fields['customers_firstname'] . ' ' . $customer->fields['customers_lastname']); ?></h3>
to this:
<h3 id="reviewsWriteReviewer" class=""><?php echo SUB_TITLE_FROM, zen_output_string_protected($customer->fields['customers_firstname'] . ' ' . $customer->fields['customers_lastname']{0} . '.'); ?></h3>
This truncates the last name to the first initial and adds a period.
Now the write a review page shows "Written by Joe B."
When you get a new review, go into the database and change the name on the review to Joe B.
hey guys, I'm trying to implement this change. I did what richuno suggested.
It seems to have worked fine on the individual pages, such as this one:
http://www.iscatech.com/ecommerce/in...4&reviews_id=8
But not on these pages:
http://www.iscatech.com/ecommerce/in...&products_id=4
http://www.iscatech.com/ecommerce/in...n_page=reviews
Thanks to Richuno and Paul3648, Ive modified the code to truncate the last name on two of the reviews pages.
There's one more page you need to modify if people are looking at a whole page of reviews. This url; www.MYSITE.COM/index.php?main_page=reviews - is driven by this page; tpl_reviews_default.php - which is also in the includes/templates/YOUR_TEMPLATE/templates directory of the other files mentioned above.
Around line 45 change the code; <div class="bold"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_short($reviews->fields['date_added'])); ?> <?php echo sprintf(TEXT_REVIEW_BY, zen_output_string_protected($reviews->fields['customers_name'])); ?></div>
to this;
<div class="bold"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_short($reviews->fields['date_added'])); ?> <?php
list($review_first_name, $review_last_name) = split(' ', zen_output_string_protected($reviews->fields['customers_name']));$last_name_array = str_split($review_last_name,1); echo sprintf(TEXT_REVIEW_BY, $review_first_name).' '.$last_name_array[0].'.'; ?></div>
Donation made. Enjoy those donuts! :-)
This will also need to be changed on the product display page itself (within the tpl_product_info_display.php). ill hunt around and post the change if I can.
Last edited by Scott_C; 5 Oct 2010 at 04:33 AM.
Donation made. Enjoy those donuts! :-)
Bookmarks