Jump to content

Increasing amount of characters in desciption


Recommended Posts

I want to increase the amount of characters in the short description for as product. Is this possible and if so where do I change it?

Cheers
Anna


Hi Anna,

You can write as much as you want in your short description. There is no restriction to it.

However, if you want to increase the count of the characters displayed in a title of a product, in a featured listing, then you need to do the following

Find the string in the homefeatured.tpl;
{$product.name|escape:htmlall:'UTF-8'|truncate:75}



Yeah, if there is anything else, do let us know.

Cheers..
Cronos
There are

Link to comment
Share on other sites



You can write as much as you want in your short description. There is no restriction to it.







Then why am I getting this error message when I enter text into my short description?

1 error
the field description_short (English (English)) is too long : 400 chars max (count now 416)
Link to comment
Share on other sites

Hi Anna,

Can you please check the following code in your Rootfolder\Adminfolder\tabs\AdminProducts.php

Go to line 630

/* Check description short size without html */
       foreach ($languages AS $language)
           if ($value = Tools::getValue('description_short_'.$language['id_lang']))
               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)).')';



You can change that 400 to which ever number greater than 400 you wish.
Lets say 600.

---

Please check the following code in Rootfolder\classes\Product.php

Go to line 332

public function validateFieldsLang($die = true)
   {
       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 false;
           }
       return parent::validateFieldsLang($die);
   }



Change 400 to 600 as we have done previously..

---

Cheers..
Cronos

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...