Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2014
    Location
    Bronx, New York, United States
    Posts
    83
    Plugin Contributions
    0

    Default Product Title in One line. add (.....) From in line end..

    i want to one line, title, to my every product in product listing page...

    like tht..


    Click image for larger version. 

Name:	before.jpg 
Views:	102 
Size:	18.4 KB 
ID:	14552

    To


    Click image for larger version. 

Name:	after.jpg 
Views:	104 
Size:	21.1 KB 
ID:	14551


    Please help
    Last edited by jennydutch; 26 Sep 2014 at 12:43 AM.

  2. #2
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Product Title in One line. add (.....) From in line end..

    The option to truncate or "limit characters" on the products name is not an option in Zen Cart (I don't think).

    You can open /includes/modules/product_listing.php

    find:

    $listing->fields['products_name']

    under case 'PRODUCT_LIST_NAME':

    and change to:
    zen_trunc_string($listing->fields['products_name'], 5)

    change 5 to the amount a characters you want to display.

    hope this helps!

    Quote Originally Posted by jennydutch View Post
    i want to one line, title, to my every product in product listing page...

    like tht..


    Click image for larger version. 

Name:	before.jpg 
Views:	102 
Size:	18.4 KB 
ID:	14552

    To


    Click image for larger version. 

Name:	after.jpg 
Views:	104 
Size:	21.1 KB 
ID:	14551


    Please help

  3. #3
    Join Date
    Apr 2014
    Location
    Bronx, New York, United States
    Posts
    83
    Plugin Contributions
    0

    Default Re: Product Title in One line. add (.....) From in line end..

    Thanks for your reply . i just change this code but i got no result....

    is my change is correct?

    /includes/modules/product_listing.php

    Code:
    case 'PRODUCT_LIST_NAME':
            $lc_align = '';
            $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id'] > 0) ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
            break;
    To


    Code:
    case 'PRODUCT_LIST_NAME':
            $lc_align = '';
            $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id'] > 0) ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_trunc_string($listing->fields['products_name'], 5) . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
            break;



    Quote Originally Posted by rbarbour View Post
    The option to truncate or "limit characters" on the products name is not an option in Zen Cart (I don't think).

    You can open /includes/modules/product_listing.php

    find:

    $listing->fields['products_name']

    under case 'PRODUCT_LIST_NAME':

    and change to:
    zen_trunc_string($listing->fields['products_name'], 5)

    change 5 to the amount a characters you want to display.

    hope this helps!

  4. #4
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Product Title in One line. add (.....) From in line end..

    The code is correct but the changes should be made in the template override directory.

    instead of /includes/modules/product_listing.php

    copy to: /includes/modules/YOUR_TEMPLATE_FOLDER/product_listing.php

    Quote Originally Posted by jennydutch View Post
    Thanks for your reply . i just change this code but i got no result....

    is my change is correct?

    /includes/modules/product_listing.php

    Code:
    case 'PRODUCT_LIST_NAME':
            $lc_align = '';
            $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id'] > 0) ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
            break;
    To


    Code:
    case 'PRODUCT_LIST_NAME':
            $lc_align = '';
            $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id'] > 0) ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_trunc_string($listing->fields['products_name'], 5) . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
            break;





  5. #5
    Join Date
    Apr 2014
    Location
    Bronx, New York, United States
    Posts
    83
    Plugin Contributions
    0

    Default Re: Product Title in One line. add (.....) From in line end..

    Quote Originally Posted by rbarbour View Post
    The code is correct but the changes should be made in the template override directory.

    instead of /includes/modules/product_listing.php

    copy to: /includes/modules/YOUR_TEMPLATE_FOLDER/product_listing.php


    Wow........ iTs working Thanks hero :) :-*

  6. #6
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Product Title in One line. add (.....) From in line end..

    Glad you got it to work!

    I'm not sure what version Zen Cart your using but I know versions 1.5.2 and 1.5.3 also allow you to append the truncated text like so:

    zen_trunc_string($listing->fields['products_name'], 25, '...more')

    It will appear like this:

    Lorem ipsum dolor sit ame...more

    Quote Originally Posted by jennydutch View Post
    Wow........ iTs working Thanks hero :) :-*

 

 

Similar Threads

  1. v150 End of Line stock
    By Neil_9481 in forum General Questions
    Replies: 0
    Last Post: 29 Jul 2012, 03:35 PM
  2. Price doesn't line up with product title
    By reach100 in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 8 Mar 2011, 06:12 AM
  3. moving a page from EZ-page line to main nav line
    By mzimmers in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 19 Jun 2010, 11:04 PM
  4. add one line of text to product description page -- how do we do that?
    By glogo in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 24 Dec 2009, 12:57 AM
  5. Cannot add more than one line in Products Description.
    By Amilo in forum General Questions
    Replies: 3
    Last Post: 11 Aug 2007, 12:40 AM

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