Page 4 of 5 FirstFirst ... 2345 LastLast
Results 31 to 40 of 43
  1. #31

    Default Re: Customer Reviews, their full name is diplayed?

    Good work Louise!

    One thing though. I was not able to find this code:
    PHP Code:
    <div class="productReviewsDefaultReviewer bold"><?php echo sprintf(TEXT_REVIEW_DATE_ADDEDzen_date_short($reviews['dateAdded'])); ?>&nbsp;<?php echo sprintf(TEXT_REVIEW_BYzen_output_string_protected($reviews['customersName'])); ?></div>
    in the file tpl_product_info_display.php per your instructions.


    However, I was able to find it in the file tpl_product_reviews_default.php located at: /templates/template_default/templates/tpl_product_reviews_default.php

    So I copied it to MY_CUSTOM_TEMPLATE folder, made the change you suggested, and then tested it in my store. Works like a charm!


    Quote Originally Posted by Louise-Paisley View Post
    The final edit needed (I think) is in tpl_product_info_display.php

    Change line 64(ish)..

    Code:
    <div class="productReviewsDefaultReviewer bold"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_short($reviews['dateAdded'])); ?>&nbsp;<?php echo sprintf(TEXT_REVIEW_BY, zen_output_string_protected($reviews['customersName'])); ?></div>
    T0..

    Code:
    <div class="productReviewsDefaultReviewer bold"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_short($reviews['dateAdded'])); ?>&nbsp;<?php 
    list($review_first_name, $review_last_name) = split(' ', zen_output_string_protected($reviews['customersName']));$last_name_array = str_split($review_last_name,1); echo sprintf(TEXT_REVIEW_BY, $review_first_name).' '.$last_name_array[0].'.'; ?></div>
    If you make the change above and these three changes already given previousely..

    richuno's solution
    Scott_C's solution
    Paul3648's solution

    All review pages will have truncated surnames including the write review page.

    The full name will still be entered into the database so I guess less than perfect but is not displayed anywhere on the cart front end unless other mods are displaying it.


    For those using dgReviews there is one more change to truncate the surname on the product page..

    find the following line in tpl_dgReveiw.php

    Code:
     <div class="bold"><?php echo sprintf(TEXT_REVIEW_BY, zen_output_string_protected($reviews->fields['customers_name'])); ?></div>
    and replace with..

    Code:
     <div class="bold"><?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>

    It took a while to get there, but I got there in the end
    Go that extra mile, you never know what's at the end of the road

    Empowerment Sanctuary

  2. #32
    Join Date
    Aug 2011
    Posts
    3
    Plugin Contributions
    0

    Default Re: Customer Reviews, their full name is diplayed?

    Thanks for this! I just swapped it and took out the name. Works perfect.

  3. #33
    Join Date
    Sep 2011
    Posts
    2
    Plugin Contributions
    0

    Default Re: Customer Reviews, their full name is diplayed?

    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:
    PHP Code:
    $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 Code:
    $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:
    PHP Code:
    $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.

  4. #34
    Join Date
    Apr 2011
    Posts
    9
    Plugin Contributions
    0

    Default Re: Customer Reviews, their full name is diplayed?

    Quote Originally Posted by BearThings View Post
    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:
    PHP Code:
    $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 Code:
    $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:
    PHP Code:
    $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.
    Thanks Bearthings. This worked for me as well.

  5. #35
    Join Date
    Aug 2010
    Posts
    33
    Plugin Contributions
    0

    Default Re: Customer Reviews, their full name is diplayed?

    This method really saves a lot of time. Works on mine.

    Just want to remind anyone that, this method only effects the newly added review. So for all previous recorded review, reviewer's names are still FULL name.

    Quote Originally Posted by BearThings View Post
    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:
    PHP Code:
    $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 Code:
    $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:
    PHP Code:
    $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.

  6. #36
    Join Date
    Sep 2011
    Posts
    2
    Plugin Contributions
    0

    Default Re: Customer Reviews, their full name is diplayed?

    Quote Originally Posted by zekin View Post
    This method really saves a lot of time. Works on mine.

    Just want to remind anyone that, this method only effects the newly added review. So for all previous recorded review, reviewer's names are still FULL name.
    Thank you zekin, I forgot to mention that. The same method can be used for existing reviews, but there are several core php files that need to be modified in a similar fashion in addition to any review based add-ons. Either that or the reviews section of the database can be manually "massaged".

    Bear

    www.Bear-Things.com

  7. #37
    Join Date
    Apr 2012
    Posts
    4
    Plugin Contributions
    0

    Idea or Suggestion Re: Customer Reviews, their full name is diplayed?

    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.

    Quote Originally Posted by BearThings View Post
    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:
    PHP Code:
    $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 Code:
    $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:
    PHP Code:
    $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.

  8. #38
    Join Date
    Jan 2010
    Location
    Tucson, AZ, USA
    Posts
    2
    Plugin Contributions
    0

    Default Re: Customer Reviews, their full name is diplayed?

    This worked great! Thank you very much! I have been trying to figure this out for a very long time now. My client will be very happy.

  9. #39
    Join Date
    May 2007
    Posts
    92
    Plugin Contributions
    0

    Default Re: Customer Reviews, their full name is diplayed?

    Quote Originally Posted by BearThings View Post
    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:
    PHP Code:
    $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 Code:
    $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:
    PHP Code:
    $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.
    Am I missing something here? I followed this instruction to the letter (version 1.3.9f) and added a review and it is still showing first and last name for the review

  10. #40
    Join Date
    Mar 2007
    Location
    Taiwan
    Posts
    241
    Plugin Contributions
    0

    Default Re: Customer Reviews, their full name is diplayed?

    I am using CONCAT on 1.5. Works for me.

    You might want to check that you are editing product_reviews_write - there are two other product_reviews folders.

    Code:
    $customer_query = "SELECT customers_firstname, CONCAT(LEFT(customers_lastname,1),'.') AS customers_lastname, customers_email_address
                       FROM " . TABLE_CUSTOMERS . "
                       WHERE customers_id = :customersID";
    Last edited by paul3648; 12 Jul 2013 at 07:57 PM.

 

 
Page 4 of 5 FirstFirst ... 2345 LastLast

Similar Threads

  1. v150 Stars and product name in reviews sidebox - customer pic
    By wyewyewye in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 26 Aug 2012, 09:09 AM
  2. How do I hide customer's last name on product reviews?
    By Bob88Vette in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 18 May 2010, 06:01 PM
  3. Problem removing customer last name from reviews using override
    By crewcut451 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 8 Sep 2009, 08:07 AM
  4. Customer Reviews - displaying the name
    By ginginca in forum General Questions
    Replies: 1
    Last Post: 18 Feb 2007, 11:52 PM
  5. Display customer full name....
    By mpadilla2 in forum Addon Sideboxes
    Replies: 0
    Last Post: 2 Jul 2006, 10:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR