zimmer-media Posted March 16, 2018 Share Posted March 16, 2018 If you want a category short description above product list and category long description under product list. Example: step 1 - database add to "prefixcategorylang" catshortdescription - varchar(180) - utf8mb4unicodeci - yes - NULL after step 2.1 modify the file “Category.php” from “/classes/Category.php”, preferably in the folder classes Override “/override/classes/Category.php” save find the line /** @var string Description */ public $description; add this /** @var string Short Description */ public $cat_short_description; step 2.2 find the line 'description' => ['type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'], add this 'cat_short_description' => ['type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'], step 3 change or copy your AdminCategoriesController.php from controllers / admin / to under override / controllers / admin / AdminCategoriesController.php for example and find the code (depending on where this additional field should appear.) find the lines 'type' => 'categories', 'label' => $this->l('Parent category'), 'name' => 'id_parent', 'tree' => [ 'id' => 'categories-tree', 'selected_categories' => $selectedCategories, 'disabled_categories' => (!Tools::isSubmit('add'.$this->table) && !Tools::isSubmit('submitAdd'.$this->table)) ? [$this->_category->id] : null, 'root_category' => $context->shop->getCategory(), ], ], an add [ 'type' => 'textarea', 'label' => $this->l('Short Description'), 'name' => 'cat_short_description', 'autoload_rte' => true, 'lang' => true, 'hint' => $this->l('Invalid characters:').' <>;=#{}', ], step 4 if you want to see this field in your frontoffice categorys view - in your theme category.tpl add and change codes add this under your tag ``` {$category->cat_short_description} at last move or change the full description under the pagination eg {if ($description)} {$category->description} {/if} ``` 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