devel Posted January 9, 2012 Share Posted January 9, 2012 Hi all! Could you please tell me how to make two lines for the products' name, when the name is too big for a single line? Check this: link Please help and thank you for your time! Link to comment Share on other sites More sharing options...
sslayer Posted January 10, 2012 Share Posted January 10, 2012 hello devel! 1. for changing product's name lenght in categories go to: /public_html/themes/your theme/product_list.tpl and search for: {$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'} change truncate(this is the number of characters) into what number you need. 2. for changing product's name on first page "homefeatured block" go to: /public_html/themes/your theme/modules/homefeatured/homefeatured.tpl and search for: title="{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'} change truncate number as you need 3 1 Link to comment Share on other sites More sharing options...
elnur Posted August 9, 2012 Share Posted August 9, 2012 It dosn't help Link to comment Share on other sites More sharing options...
marcko Posted November 29, 2012 Share Posted November 29, 2012 hello devel! 1. for changing product's name lenght in categories go to: /public_html/themes/your theme/product_list.tpl and search for: {$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'} change truncate(this is the number of characters) into what number you need. 2. for changing product's name on first page "homefeatured block" go to: /public_html/themes/your theme/modules/homefeatured/homefeatured.tpl and search for: title="{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'} change truncate number as you need this was very useful to me! It finally worked. Thanks. Link to comment Share on other sites More sharing options...
Ana Silva Posted October 12, 2013 Share Posted October 12, 2013 Nice! Worked for me as well! This post should be marked as solved, no? Link to comment Share on other sites More sharing options...
pildo Posted November 26, 2013 Share Posted November 26, 2013 It dosn't help go to admin - Advanced Parameters - Performance and here enable force compilation. if dont help, try delete cache (also here). Link to comment Share on other sites More sharing options...
vekia Posted November 26, 2013 Share Posted November 26, 2013 go to admin - Advanced Parameters - Performance and here enable force compilation. if dont help, try delete cache (also here). it's a post from 2012 .... Link to comment Share on other sites More sharing options...
nspinheiro Posted December 1, 2013 Share Posted December 1, 2013 Hi I also need this, but this solution did not helped on my theme i can see that it indeed increased a few char's but i believe that the problem is that it should have a second line for the product name. How can i add it? Thanks Link to comment Share on other sites More sharing options...
vekia Posted December 1, 2013 Share Posted December 1, 2013 everything depends on your theme. you have to increase height of product name object (div/span whatever) Link to comment Share on other sites More sharing options...
nspinheiro Posted December 2, 2013 Share Posted December 2, 2013 This is solved, thanks Link to comment Share on other sites More sharing options...
WebUp Posted January 10, 2014 Share Posted January 10, 2014 everything depends on your theme. you have to increase height of product name object (div/span whatever) If I want to add two lines to my home page products, I have to change homefeatured.tpl? Do I have to add span/div for height? Where exactly can I change it: <li class="ajax_block_product "> <a class="product_image" href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}" class="product_image"> <img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')}" alt="{$product.name|escape:html:'UTF-8'}" /> </a> <h5><a class="product_link" href="{$product.link}" title="{$product.name|truncate:50:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:25:'...'|escape:'htmlall':'UTF-8'}</a></h5> {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE} Link to comment Share on other sites More sharing options...
vekia Posted January 10, 2014 Share Posted January 10, 2014 If I want to add two lines to my home page products, I have to change homefeatured.tpl? two lines of? of products? if so, just define highest / lowest product number on module configuration page (modules > modules > homefeatured > configure) product list will be splitted to two lines then. Do I have to add span/div for height? Where exactly can I change it: in css styles (homefeatured.css) - height param for <li> object. Link to comment Share on other sites More sharing options...
fong hong Posted November 6, 2014 Share Posted November 6, 2014 Previous for me is truncate:25 NOW i change to truncate:55 Solved for me 1.5.6.1 here 1. for changing product's name lenght in categories go to:/public_html/themes/your theme/product_list.tpl and search for:{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'}change truncate(this is the number of characters) into what number you need. Solved for me 1.5.6.1 here www.7zhop.com Link to comment Share on other sites More sharing options...
Przemysław Suszek Posted December 15, 2014 Share Posted December 15, 2014 Solved for me with PS 1.6.0.7 Link to comment Share on other sites More sharing options...
Derres Posted January 26, 2016 Share Posted January 26, 2016 (edited) two lines of? of products? if so, just define highest / lowest product number on module configuration page (modules > modules > homefeatured > configure) product list will be splitted to two lines then. in css styles (homefeatured.css) - height param for <li> object. Sorry what is needed exactly to do in css file for increase the white lines of title also if they are short than the truncate ? All titles need to keep the same number of lines also if they are short. Product list now, in grid mode, seems setted by default at 2 lines becouse products also if they have one line they keep 2. How i can increase that to three ? Thanks Edited January 26, 2016 by Derres (see edit history) Link to comment Share on other sites More sharing options...
[email protected] Posted January 31, 2016 Share Posted January 31, 2016 I'm using a leo theme so I don't know if the solution is the same for you but I can tell you what I did. Inspect the code, search for the css that apply to the name and, if it isn't truncated, you only have to increase the height property. Link to comment Share on other sites More sharing options...
c.m Posted November 8, 2017 Share Posted November 8, 2017 I have done the modification in prestashop 1.7, but now the price doesn't fit in the product box anymore. How can I adapt the container? Link to comment Share on other sites More sharing options...
ilisiaraul Posted October 28, 2022 Share Posted October 28, 2022 I have found a solution. Just remove from css .product_name */ /* white-space: nowrap; and change height Link to comment Share on other sites More sharing options...
MURAT ONUR YUKSEL Posted May 28, 2023 Share Posted May 28, 2023 I increased the truncate from 30 to 40, and added style for div's height. Not a good solution but simple. .../miniatures/product.tpl <div class="product-description" style="height:60px;"> {block name='product_name'} {if $page.page_name == 'index'} <h3 class="h3 product-title"><a href="{$product.url}" content="{$product.url}">{$product.name|truncate:40:'...'}</a></h3> {else} <h2 class="h3 product-title"><a href="{$product.url}" content="{$product.url}">{$product.name|truncate:40:'...'}</a></h2> {/if} {/block} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now