Genet Posted November 28, 2011 Share Posted November 28, 2011 Hello, I have edited "truncates" in product-list.tpl, but nothing has changed. Where can I change the length ?The product name is not showing completely. Thank you!!! Link to comment Share on other sites More sharing options...
dannyd Posted January 13, 2012 Share Posted January 13, 2012 Is there anyone who can help with this very important issue. I think I've browsed through entire forum looking for solution. So far nada. Editing product-list.tpl from themes/prestashop doesn't change a thing. I'm on prestashop 1.4.4.1 I find this unbelievable that there is no one who can provide a solution for this. Link to comment Share on other sites More sharing options...
dannyd Posted January 15, 2012 Share Posted January 15, 2012 Home page of prestashop says: "Best Open-Source E-commerce Application". My question: IS IT REALLY ??? Since apparently it can't even properly display product titles and there is no way to change it. I've tried editing many lines with 'truncate' and it doesn't help. Apparently many other people on this forum face the same issue. Maybe one of the developers can answer this one??? Link to comment Share on other sites More sharing options...
PrestaShopDeveloper Posted January 15, 2012 Share Posted January 15, 2012 The product names are limited to 128 characters. You can always remove that limitation, but you'll need some knowledge of SQL & PHP - it can't be changed just my removing thte "truncate" modifier from the template. Link to comment Share on other sites More sharing options...
dannyd Posted January 17, 2012 Share Posted January 17, 2012 Thank you for your answer. But there's one thing I can't understand. The original value of 'truncate' in product-list.tpl is '35'. And whether I change it to 60, 80 or 100, it's like prestashop doesn't see this and titles' length doesn't change at all. The weird part is that titles are sometimes cut at 29 characters, other time it's 24 or 33 characters. I honestly give up. I really wished the product names were limited to 128 characters. That would be all I need. But I can't come anywhere near that value. Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
Mike Kranzler Posted January 17, 2012 Share Posted January 17, 2012 Hi danny, You should be able to change the value in the "name" field of the ps_product_lang table of your database. After that, just replace the value with your new value in your classes/product.php file and that should take care of it for you. I hope this helps. -Mike Link to comment Share on other sites More sharing options...
dannyd Posted January 17, 2012 Share Posted January 17, 2012 That value is set to "varchar(128)" in my database as well as in classes/Product.php. I set "truncate" to 128 in product-list.tpl So it is my understanding that product names should be 128 characters long. However, they are shortened at around 30 characters. Does language version of prestashop have anything to do with it? Mine is polish. Thx. Link to comment Share on other sites More sharing options...
Mike Kranzler Posted January 23, 2012 Share Posted January 23, 2012 Hi danny, In your theme's product-list.tpl file, locate the following line (should be around line 42 in v1.4.6.2) {$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'} and increase the truncate value from 35 to whatever you would like it to be. Please let me know if this works for you. -Mike Link to comment Share on other sites More sharing options...
emanuelt Posted January 28, 2012 Share Posted January 28, 2012 I am a novice in Prestashop but this worked for me: You have to force Smarty to recompile the new changed values. Go to Back Office > Preferences > Performance. In Smarty force compile. Check if is OK now, and them disable force compile for speed. I hope I was helpful. 1 1 Link to comment Share on other sites More sharing options...
dannyd Posted January 31, 2012 Share Posted January 31, 2012 I am a novice in Prestashop but this worked for me: You have to force Smarty to recompile the new changed values. Go to Back Office > Preferences > Performance. In Smarty force compile. Check if is OK now, and them disable force compile for speed. I hope I was helpful. It seems like that was it !!! Thank you big time. I would put 'SOLVED' in the topic's title but I'm not the author. Link to comment Share on other sites More sharing options...
Mike Kranzler Posted January 31, 2012 Share Posted January 31, 2012 It seems like that was it !!! Thank you big time. I would put 'SOLVED' in the topic's title but I'm not the author. If we can get Genet to confirm that this worked for him as well, I'll be happy to mark this thread as solved. -Mike 2 Link to comment Share on other sites More sharing options...
mobilafitness Posted September 19, 2012 Share Posted September 19, 2012 worked for , thanks! Link to comment Share on other sites More sharing options...
nspinheiro Posted December 1, 2013 Share Posted December 1, 2013 Hi. I get this old post because for incresing the truncate value does not solve it, i need it to continue to a second line. How can i add this second line? Thanks Link to comment Share on other sites More sharing options...
vekia Posted December 1, 2013 Share Posted December 1, 2013 what ps version, what theme ? 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...
vekia Posted December 2, 2013 Share Posted December 2, 2013 how you solved it? where the problem was? Link to comment Share on other sites More sharing options...
nspinheiro Posted December 2, 2013 Share Posted December 2, 2013 I had to change the global.css: From ul.product_list h5{ overflow: hidden; white-space: nowrap; font-size: 1.2em; To ul.product_list h5{ overflow: hidden; white-space: wrap; font-size: 1.2em; min-height : 44px; max-height: 44px; This way it didnt wrap the text. The Height has to be set like this for all products to be align. 1 Link to comment Share on other sites More sharing options...
StrangeAttractor Posted October 7, 2014 Share Posted October 7, 2014 The product names are limited to 128 characters. You can always remove that limitation, but you'll need some knowledge of SQL & PHP - it can't be changed just my removing thte "truncate" modifier from the template. I have removed (just increasing the numbers did seemingly no effect) all and every truncate thing I could find and changed `ps_product_lang`.`name` (as well as `ps_product_lang`.`meta_title`) type from VARCHAR(128) to VARCHAR(255). Although removing the truncates has improved the things greatly,the 128-character product title limitation is still there (I have got a couple of goods that don't fit: one with 133-symbol-long name and another with 152-symbol-long). PrestaShop still refuses longer titles (via CSV import as well as via the products catalog interface). There seem to be some validation stuff with this limit hard-coded somewhere, I am going to try to find it... Link to comment Share on other sites More sharing options...
StrangeAttractor Posted October 7, 2014 Share Posted October 7, 2014 (edited) There seem to be some validation stuff with this limit hard-coded somewhere, I am going to try to find it... Looks like it's in the \classes\Product.php file... 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => true, 'size' => 128), PS: Thanks G-d (and the authors) PrestaShop has source code and database structure this sane, it really is the best thing I like about PrestaShop (although there still are things that seem mysterious to me like some parameters (like ggoods additional shipping costs) keeping their old values (where the heck is this data remembered? I have turned all the caches I could find off!) after I change them in the database using SQL). Edited October 7, 2014 by StrangeAttractor (see edit history) 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