Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Length of Text Displayed on Customer Reviews Page

    If you look at my reviews page here:

    http://www.limelites.co.uk/index.php?main_page=reviews

    you'll see that a lot of the review texts are cut short and truncated. Is there a simple way to increase the length of characters that's allowed on this page, so that the entire text is displayed in each review? There is certainly enough space.

  2. #2
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Length of Text Displayed on Customer Reviews Page

    in includes/templates/yourtemplate/templates/tpl_reviews_default.php fin the line:

    Code:
    <div class="content"><?php echo zen_break_string(nl2br(zen_output_string_protected(stripslashes($reviews->fields['reviews_text']))), 60, '-<br />') . ((strlen($reviews->fields['reviews_text']) >= 100) ? '...' : ''); ?></div>
    About line 43.

    It is the 60 and the 100 that you are interested in. The 60 is the length of the string and the 100 is where it decides to put the ... in.

  3. #3
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Length of Text Displayed on Customer Reviews Page

    But if you want the whole thing try :

    Code:
    <div class="content"><?php echo nl2br(zen_output_string_protected(stripslashes($reviews->fields['reviews_text'])))?></div>

  4. #4
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Length of Text Displayed on Customer Reviews Page

    Thanks for the reply.... I changed the 60 to 600 and the 100 to 1000, but now insterad of the .... it just cuts off the review, dead.

  5. #5
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Length of Text Displayed on Customer Reviews Page

    Quote Originally Posted by niccol View Post
    But if you want the whole thing try :

    Code:
    <div class="content"><?php echo nl2br(zen_output_string_protected(stripslashes($reviews->fields['reviews_text'])))?></div>
    Nope, that does the same thing, just cuts the review text off dead. So where the '...' once was there's just nothing, but it still doesn't show the full text.

  6. #6
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Length of Text Displayed on Customer Reviews Page

    I'd need to add something to the code that allows the review to take up multiple lines... increasing the 100 to 10000 seems to get rid of the '...' but still doesn't allow the full review to display.

  7. #7
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Length of Text Displayed on Customer Reviews Page

    Sorry. It seems to be done in the sql query as well. So, stick to my final version and have a look at:

    includes/modules/pages/reviews/header_php.php

    Have a look at line 17
    Code:
    $reviews_query_raw = "SELECT r.reviews_id, left(rd.reviews_text, 100) AS reviews_text, r.reviews_rating, r.date_added, p.products_id, pd.products_name, p.products_image, r.customers_name
    which truncates the reviews_text to 100. Works for me....

  8. #8
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Length of Text Displayed on Customer Reviews Page

    And now that I have actually looked at what zen_break_string actually does I will take back what I originally said.

    I made an assumption that it truncated the string after a certain number of characters. It doesn't. Ah, assumptions, mother of all ####-ups.

    What it does is split up very long words to allow for word wrap and so that they don't break the layout. So, if a word is longer than 60 characters in the review it will break it up.

    So, go back to the original version of the tpl_reviews_default file and make the edits I have suggested to the header_php.php file. You will want to put some limit in on this file (let's say 2000).

    All that means is that in the tpl_reviews_default file you would want to change the 100 to 2000.

    Sorry for messing you around. There is some phrase that involves assumptions making an ###### of u but I can't remember it now.

  9. #9
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Length of Text Displayed on Customer Reviews Page

    Hi Niccol,

    You got it though....header_php.php........ line 17, changed rd.reviews_text, from 100 to 10000 and now thef full review text shows :-) Thank you for helping me out, I owe you one.......

  10. #10
    Join Date
    Oct 2007
    Posts
    412
    Plugin Contributions
    0

    Default Re: Length of Text Displayed on Customer Reviews Page

    I have changed the number from 100 to 10000 in

    includes/modules/pages/reviews/header_php.php

    and in

    includes/templates/yourtemplate/templates/tpl_reviews_default.php

    but still the reviews are truncated

    Im using Zen Cart 1.3.8a. Anybody got this working? or knows how to get it working? Any help is much appreciated.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v138a Customer reviews for main page
    By perfumbg in forum General Questions
    Replies: 0
    Last Post: 14 Sep 2012, 04:55 PM
  2. Customer Reviews - page does nothing? 1.3.8
    By dr_james_leo in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 27 Aug 2010, 07:47 AM
  3. Full Length Reviews
    By scytha in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 27 Dec 2009, 02:20 AM
  4. Length of Street Address Text Box on Create Account Page
    By Picci in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 14 Dec 2007, 09:40 PM
  5. text on the page not displayed
    By mikajlo in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 5 Oct 2006, 11:58 PM

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