haishui Posted October 18, 2009 Share Posted October 18, 2009 Dear Experts:I Have a questions on the proudct short descripton max character, and now, when I input over 400 character I can’t save my product, and get the below alert event, 1 errorthe field description_short (English (English)) is too long : 400 chars max (count now 3912) so I want increase the max character limit. but I have looked the mysql table product_lang the long descripton and short descripton is configure same. so I think the limit maybe not on mysql table,please kindly give a advices for the issue slove,thanks so much.Best Regards.Herny Link to comment Share on other sites More sharing options...
haishui Posted October 18, 2009 Author Share Posted October 18, 2009 after change the AdminProducts.php & product.php the problem was fixed. thanks all. Link to comment Share on other sites More sharing options...
Unsought_ Posted October 18, 2009 Share Posted October 18, 2009 plz share...i altered ( changed ) products.php truncate was 100 and now its 200 but what about adminProducts ??Kind regards Patrick Link to comment Share on other sites More sharing options...
KIH999 Posted October 18, 2009 Share Posted October 18, 2009 [sloved] Slowed maybe? :-) Link to comment Share on other sites More sharing options...
morepork Posted December 1, 2009 Share Posted December 1, 2009 I have come up against the same issue and want to be able to modify that 400 limitation to 500 - but I don't understand from the above posts how this can be resolved. Can anyone clarify this a little more? Which specific pieces of which documents need to be changed? 1 Link to comment Share on other sites More sharing options...
rocky Posted December 1, 2009 Share Posted December 1, 2009 Change lines 667-668 of admin/tabs/AdminProducts.php from: if (Tools::strlen(strip_tags($value)) > 400) $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), 'description_short').' ('.$language['name'].') '.$this->l('is too long').' : 400 '.$this->l('chars max').' ('.$this->l('count now').' '.Tools::strlen(strip_tags($value)).')'; to: if (Tools::strlen(strip_tags($value)) > 500) $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), 'description_short').' ('.$language['name'].') '.$this->l('is too long').' : 500 '.$this->l('chars max').' ('.$this->l('count now').' '.Tools::strlen(strip_tags($value)).')'; Link to comment Share on other sites More sharing options...
morepork Posted December 1, 2009 Share Posted December 1, 2009 After making that change and trying to enter the product description in a product record I get the following error message:Hack attempt (Product->description: length > 400 for language 1) Link to comment Share on other sites More sharing options...
rocky Posted December 1, 2009 Share Posted December 1, 2009 Sorry, was in a rush and I forgot about the other file. You need to also modify classes/Product.php and change: foreach ($this->description_short as $k => $value) if (Tools::strlen(strip_tags($value)) > 400) { if ($die) die (Tools::displayError().' ('.get_class($this).'->description: length > 400 for language '.$k.')'); return $errorReturn ? get_class($this).'->'.Tools::displayError('description: length > 400 for language').' '.$k : false; } return parent::validateFieldsLang($die, $errorReturn); to: foreach ($this->description_short as $k => $value) if (Tools::strlen(strip_tags($value)) > 500) { if ($die) die (Tools::displayError().' ('.get_class($this).'->description: length > 500 for language '.$k.')'); return $errorReturn ? get_class($this).'->'.Tools::displayError('description: length > 500 for language').' '.$k : false; } return parent::validateFieldsLang($die, $errorReturn); 1 Link to comment Share on other sites More sharing options...
morepork Posted December 1, 2009 Share Posted December 1, 2009 Terrific thanks Rocky - perfect :-) Link to comment Share on other sites More sharing options...
taoreflex Posted September 11, 2010 Share Posted September 11, 2010 I have two sites which have some products in common (v. 1.3.1). For some products the short description was too short, so I followed the instructions here and extended it to 500. Then I had a product which needed 547 characters in the short description, so I repeated these steps and extended the short description to 575 characters, but it still got truncated. I then reduced the characters until the last part of the text was visible. So I was already puzzled that even though I had increased the maximum number of characters to well in excess of the number of characters in this product's short description, it was still getting truncated. I then noticed that on the 2nd site, items that had shown untruncated on the first site, were still getting truncated, even though the settings were identical (checked and rechecked). As I wanted to put the same product that I had just added to the first site onto the second site, and therefore needed to increase the length of the short description on the second site as well, I copied the entire adminproducts and product files from the 1st site to the 2nd site. So even if my check and recheck was faulty, now I could be 100% certain that the settings for the short description are identical, yet they display differently with less truncation on the first site than on the second. No warning comes up on either site as the products are saved so it would seem that the software is expecting the short descriptions to display correctly. Font and font size are also identical yet they also display slightly differently.Anybody have any ideas on this strange anomaly? Link to comment Share on other sites More sharing options...
rocky Posted September 12, 2010 Share Posted September 12, 2010 It looks like it is Smarty that is truncating the description. You will need to change line 9 of product-list.tpl in your theme's directory (in PrestaShop v1.3.1): <a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}">{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'} Increase the truncate value from 360 characters to the number of characters you want displayed before "..." is displayed, or just delete the |truncate:360:'...' part altogether if you never want any truncation. Link to comment Share on other sites More sharing options...
taoreflex Posted September 13, 2010 Share Posted September 13, 2010 Thanks Rocky, that did the trick.Guess that Smarty isn't as smart as it thinks. Link to comment Share on other sites More sharing options...
GeoffyB Posted September 13, 2010 Share Posted September 13, 2010 Hi,Truncation works for the short description when products are listed in their categories, but how would you truncate the short description on the actual product page? I think you need to add something to product.tpl but cannot figure out what?Any ideas?Cheers,Geoff Link to comment Share on other sites More sharing options...
GeoffyB Posted September 13, 2010 Share Posted September 13, 2010 Never mind, found it You replace line 44 of product.tpl from this: {$product->description_short} to this: {$product->description_short|truncate:100:'...'} Cheers,Geoff Link to comment Share on other sites More sharing options...
bbyamoh Posted April 3, 2011 Share Posted April 3, 2011 I have followed the instructions to increase my short desc from 400 to 900 as i want the longest descriptions in there, but i still get this error:MRR 326: cannot be savedProduct->description: length > 400 for language 1MRR 333: cannot be savedProduct->description: length > 400 for language 1what do i do? Link to comment Share on other sites More sharing options...
karelzemek Posted September 23, 2011 Share Posted September 23, 2011 Hello, in older version was everything OK, but in 1.4 it's not working... How I do it? Thank you. Link to comment Share on other sites More sharing options...
Neeeedhelpfastpls Posted October 11, 2011 Share Posted October 11, 2011 Hi, have you managed to solve this problem? I am facing this as well. Have tried the above method from rocky but still the error. Link to comment Share on other sites More sharing options...
castel Posted November 22, 2011 Share Posted November 22, 2011 ... to my surprise problem with "Short description max character limit" was... HyperTRANSLATE 4.0.0 Add-on for Firefox 8. After uninstall - all is OK Link to comment Share on other sites More sharing options...
yard Posted January 25, 2012 Share Posted January 25, 2012 For PrestaShop™ 1.4.6.2: I was increase limit in AdminProducts.php:1136 /* Check description short size without html */ $limit = (int)Configuration::get('PS_PRODUCT_SHORT_DESC_LIMIT'); if ($limit <= 0) $limit = 1200; and obtain error: Fatal error (Product->description_short: length > 800 for language 6) Only 800 chars I can input into short desc Link to comment Share on other sites More sharing options...
Vilas Posted February 20, 2012 Share Posted February 20, 2012 Hi, I am also getting same kind of error "the field description_short (English (English)) is too long : 1 chars max (count now 9)" I am using PS 1.4.7.0 It will be great if anyone help me. Thanks Link to comment Share on other sites More sharing options...
nikmagnus Posted February 22, 2012 Share Posted February 22, 2012 Can anyone please suggest a method of changing the core files using the overrider folder. I'm told that if you change the core code updating PS becomes a hassle. Thanks. Link to comment Share on other sites More sharing options...
icyhot Posted March 20, 2012 Share Posted March 20, 2012 I am bumping this thread as I'm also one of the 1.4.7 users. Has anybody figured out the solution yet? Link to comment Share on other sites More sharing options...
Vilas Posted March 26, 2012 Share Posted March 26, 2012 Dear Icyhot, Yes I have got solution. There was option under preferences --- product. In that check short description limit field. If its 0 then increase as per your wish. Thanks 2 Link to comment Share on other sites More sharing options...
Roffleman Posted August 10, 2013 Share Posted August 10, 2013 In Prestashop 1.5.4 controllers/admin/AdminProductsController at line 1952. // Check description short size without html $limit = (int)Configuration::get('PS_PRODUCT_SHORT_DESC_LIMIT'); if ($limit <= 0) $limit = 400; Current limit is 400, so if you dont find the line, just search for "400" and then change the number to whatever u wish. Link to comment Share on other sites More sharing options...
jakubjakub Posted September 18, 2013 Share Posted September 18, 2013 I changed everything but still have this problem: Property Product->description_short length (1153) must be between 0 and 800 at line 872 in file classes/ObjectModel.php Link to comment Share on other sites More sharing options...
User1234567891 Posted September 18, 2013 Share Posted September 18, 2013 In prestashop 1.5 it can be found in controllers/admin/AdminProductscontroller.php Link to comment Share on other sites More sharing options...
vekia Posted September 18, 2013 Share Posted September 18, 2013 have you tried to change length under preferences >products tab? 3 Link to comment Share on other sites More sharing options...
jakubjakub Posted September 19, 2013 Share Posted September 19, 2013 I changed in adminproductscontroller.php and in products tab, doesn't work. Presta 1.5.3.1 Link to comment Share on other sites More sharing options...
vekia Posted September 19, 2013 Share Posted September 19, 2013 you must use at least 1153 characters. if you change value of this param in back office - it appears well there? check PS_PRODUCT_SHORT_DESC_LIMIT setting in your database, in configuration table isn't this field duplicated in this table? Link to comment Share on other sites More sharing options...
jakubjakub Posted September 20, 2013 Share Posted September 20, 2013 (edited) Im looking in configuration table, but there isn't 'PS_PRODUCT_SHORT_DESC_LIMIT''.. In back office it appears well. EDIT. Ok, now its working. Edited September 20, 2013 by jakubjakub (see edit history) 1 Link to comment Share on other sites More sharing options...
daniley Posted September 25, 2014 Share Posted September 25, 2014 Im looking in configuration table, but there isn't 'PS_PRODUCT_SHORT_DESC_LIMIT''.. In back office it appears well. EDIT. Ok, now its working. this work on my prestashop 1.6 `ps_configuration` -> PS_PRODUCT_SHORT_DESC_LIMIT and edit value text cange 255 - to other Link to comment Share on other sites More sharing options...
pkodevphp Posted February 27, 2015 Share Posted February 27, 2015 (edited) Hi guys, In prestashop 1.6, the max length of short description is a preference product option, to change the max length of an other of product as name: 1)override Product with the new length class Product extends ProductCore{ public function __construct($id_product = null, $full = false, $id_lang = null, $id_shop = null, Context $context = null) { self::$definition['fields']['name']['size'] = 255; parent::__construct($id_product, $full, $id_lang, $id_shop, $context); } } 2) change in mysql the setting length of the field name in the table product_lang to new value 3) purge the cache with a delete of cache/class_index.php to launch your override of Product.php Best Edited February 27, 2015 by pkodevphp (see edit history) Link to comment Share on other sites More sharing options...
IED Factory Posted September 19, 2017 Share Posted September 19, 2017 Hello,I am looking for ways to remove the limitation to 6000 characters from the Description field in a PS 1.7.2.2.Can you help me?Thank you for your comeback.Stephane. Link to comment Share on other sites More sharing options...
IED Factory Posted September 19, 2017 Share Posted September 19, 2017 Réponsele fichier a modifié se trouve : src/PrestaShopBundle/Form/Admin/Product/ProductInformation.phpModifier les deux valeurs 6 000 ligne 161 et 165 à la valeur désirée. Link to comment Share on other sites More sharing options...
Shuvankar Paul Posted October 28, 2017 Share Posted October 28, 2017 You can change it from Admin Panel setting. Read this article. https://equaltrue.com/blog/fixing-non-breaking-space-nbsp-issue-wordpress/ Link to comment Share on other sites More sharing options...
Sellmark Posted May 17, 2018 Share Posted May 17, 2018 `ps_configuration` -> PS_PRODUCT_SHORT_DESC_LIMIT Does the job. 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