getFieldValue($obj, 'description', (int)($language)), ENT_COMPAT, 'UTF-8').' '; whith echo ' '.htmlentities($this->getFieldValue($obj, 'description', (int)($language)), ENT_COMPAT, 'UTF-8').' '; $iso = Language::getIsoById((int)($cookie->id_lang)); $isoTinyMCE = (file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en'); …" /> getFieldValue($obj, 'description', (int)($language)), ENT_COMPAT, 'UTF-8').' '; whith echo ' '.htmlentities($this->getFieldValue($obj, 'description', (int)($language)), ENT_COMPAT, 'UTF-8').' '; $iso = Language::getIsoById((int)($cookie->id_lang)); $isoTinyMCE = (file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en'); …" /> Prestashop, HTML description in category. | Adrian Badowski

Simple way to change stylesheet:

$("#StyleContrast").click(function() {
   $("link[media='screen']").attr("href", "Contrast.css");
 });
 
 $("#StylePrint").click(function() {
   $("link[media='screen']").attr("href", "Print.css");
 });
 
 $("#StyleNormal").click(function() {
   $("link[@media='screen']").attr("href", "Normal.css");
 });

1. Change in [admin folder]/tabs/AdminCategories.php
Approx line 232, replace

echo '
';

whith

echo '
					
'; $iso = Language::getIsoById((int)($cookie->id_lang)); $isoTinyMCE = (file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en'); $ad = dirname($_SERVER["PHP_SELF"]); echo ' ';

2. Change in classes/Category.php
Approx. line 88, replace

 protected   $fieldsValidateLang = array('name' => 'isCatalogName', 'link_rewrite' => 'isLinkRewrite', 'description' => 'isCleanHtml',  
'meta_title' => 'isGenericName', 'meta_description' => 'isGenericName', 'meta_keywords' => 'isGenericName');  

with

protected   $fieldsValidateLang = array('name' => 'isCatalogName', 'link_rewrite' => 'isLinkRewrite', 'description' => 'isString',  
'meta_title' => 'isGenericName', 'meta_description' => 'isGenericName', 'meta_keywords' => 'isGenericName');  

3. Change in classes/ObjectModel.php
Approx. line 371, replace

if ((!$this->id_lang AND isset($this->{$field}[$id_language]) AND !empty($this->{$field}[$id_language])) 
			OR ($this->id_lang AND isset($this->$field) AND !empty($this->$field)))		
				$fields[$id_language][$field] = $this->id_lang ? pSQL($this->$field) : pSQL($this->{$field}[$id_language]);			
			elseif (in_array($field, $this->fieldsRequiredLang))
				$fields[$id_language][$field] = $this->id_lang ? pSQL($this->$field) : pSQL($this->{$field}[Configuration::get('PS_LANG_DEFAULT')]);
			else
				$fields[$id_language][$field] = ''; 

with

if ((!$this->id_lang AND isset($this->{$field}[$id_language]) AND !empty($this->{$field}[$id_language])) 
			OR ($this->id_lang AND isset($this->$field) AND !empty($this->$field))){
				if(isset($this->fieldsValidateLang[$field]) && $this->fieldsValidateLang[$field]=='isString'){  
					$fields[$id_language][$field] = $this->id_lang ? pSQL($this->$field) : pSQL($this->{$field}[$id_language],'true');
				}else{  		
					$fields[$id_language][$field] = $this->id_lang ? pSQL($this->$field) : pSQL($this->{$field}[$id_language]);
				} 
			}
			elseif (in_array($field, $this->fieldsRequiredLang))
				$fields[$id_language][$field] = $this->id_lang ? pSQL($this->$field) : pSQL($this->{$field}[Configuration::get('PS_LANG_DEFAULT')]);
			else
				$fields[$id_language][$field] = ''; 

4. Change in controllers/categoryController.php
Approx. line 120, replace

$this->category->description = nl2br2($this->category->description);

with

$this->category->description = $this->category->description;

Leave a reply

Your email address will not be published.