<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>NemoPS &#187; categories</title>
	<atom:link href="https://nemops.com/tag/categories/feed/" rel="self" type="application/rss+xml" />
	<link>https://nemops.com</link>
	<description>Prestashop Tutorials, Modules and More!</description>
	<lastBuildDate>Wed, 05 Dec 2018 13:25:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.35</generator>
	<item>
		<title>Displaying all Categories of a Product in PrestaShop</title>
		<link>https://nemops.com/prestashop-all-product-categories/</link>
		<comments>https://nemops.com/prestashop-all-product-categories/#comments</comments>
		<pubDate>Wed, 16 Dec 2015 13:13:03 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Theming]]></category>
		<category><![CDATA[categories]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[product]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=2675</guid>
		<description><![CDATA[<p>In this quick tip we will extend the Product Controller and template, and display all categories a product belongs to, in PrestaShop</p>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-all-product-categories/">Displaying all Categories of a Product in PrestaShop</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In this quick tip we will extend the Product Controller and template, and display all categories a product belongs to, in PrestaShop.<br />
<span id="more-2675"></span></p>
<h2>Watch the screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/1YDZE9IkA1o" frameborder="0" allowfullscreen></iframe><p><a href="https://www.youtube.com/user/NemoPostScriptum/videos" rel="nofollow" title="Subscribe Post Scriptum's Youtube Channel">Subscribe Post Scriptum's Youtube Channel</a></p>	</div>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-all-product-categories/">Displaying all Categories of a Product in PrestaShop</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://nemops.com/prestashop-all-product-categories/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Limiting subcategories in the Prestashop Top Menu</title>
		<link>https://nemops.com/prestashop-top-menu-limit-subcategories/</link>
		<comments>https://nemops.com/prestashop-top-menu-limit-subcategories/#comments</comments>
		<pubDate>Wed, 13 May 2015 10:04:24 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[categories]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[top menu]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=2419</guid>
		<description><![CDATA[<p>In this quick tip we will see how to limit the number of subcategories the top menu displays in Prestashop. Watch the Screencast Text Version Notice: if you are using a Prestashop version newer than 1.6.0.11, it&#8217;s recommended to apply this modification with an override, as explained here: How to override Prestashop modules Open up [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-top-menu-limit-subcategories/">Limiting subcategories in the Prestashop Top Menu</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In this quick tip we will see how to limit the number of subcategories the top menu displays in Prestashop.<br />
<span id="more-2419"></span></p>
<h2>Watch the Screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/qSevEeTPHo0#038;feature=youtu.be" frameborder="0" allowfullscreen></iframe><p><a href="https://www.youtube.com/user/NemoPostScriptum/videos" rel="nofollow" title="Subscribe Post Scriptum's Youtube Channel">Subscribe Post Scriptum's Youtube Channel</a></p>	</div>
<div class="separator"></div>
<h2>Text Version</h2>
<p><strong>Notice:</strong> if you are using a Prestashop version newer than 1.6.0.11, it&#8217;s recommended to apply this modification with an override, as explained here: <a href="http://nemops.com/override-prestashop-modules-core/#.VVMZ4fnzrmg" target="_blank" title="How to override Prestashop modules">How to override Prestashop modules</a></p>
<p>Open up modules/blocktopmenu/blocktopmenu.php</p>
<p>Locate the following method: </p>
<pre class="brush: php; title: ; notranslate">
protected function generateCategoriesMenu($categories, $is_children = 0)
</pre>
<p>Inside it, you will notice a conditional block</p>
<pre class="brush: php; title: ; notranslate">
			if (isset($category['children']) &amp;&amp; !empty($category['children']))
			{
				$html .= '&lt;ul&gt;';
				$html .= $this-&gt;generateCategoriesMenu($category['children'], 1);

				if ((int)$category['level_depth'] &gt; 1 &amp;&amp; !$is_children)
				{
					$files = scandir(_PS_CAT_IMG_DIR_);

					if (count($files) &gt; 0)
					{
						$html .= '&lt;li class=&quot;category-thumbnail&quot;&gt;';

						foreach ($files as $file)
							if (preg_match('/^'.$category['id_category'].'-([0-9])?_thumb.jpg/i', $file) === 1)
								$html .= '&lt;div&gt;&lt;img src=&quot;'.$this-&gt;context-&gt;link-&gt;getMediaLink(_THEME_CAT_DIR_.$file)
								.'&quot; alt=&quot;'.Tools::SafeOutput($category['name']).'&quot; title=&quot;'
								.Tools::SafeOutput($category['name']).'&quot; class=&quot;imgm&quot; /&gt;&lt;/div&gt;';

						$html .= '&lt;/li&gt;';
					}
				}

				$html .= '&lt;/ul&gt;';
			}
</pre>
<p>We can do a number of things here. If we comment it out, all submenus will be removed. Otherwise, we can reduce and limit the subcategory levels:</p>
<pre class="brush: php; title: ; notranslate">
			if ($category['level_depth'] &lt; 4 &amp;&amp; isset($category['children']) &amp;&amp; !empty($category['children']))
			{
			...
</pre>
<p>In this case, levels over 3 will not be displayed!</p>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-top-menu-limit-subcategories/">Limiting subcategories in the Prestashop Top Menu</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://nemops.com/prestashop-top-menu-limit-subcategories/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Prestashop 101 Day 3 &#8211; Categories and products</title>
		<link>https://nemops.com/prestashop-categories-and-products/</link>
		<comments>https://nemops.com/prestashop-categories-and-products/#comments</comments>
		<pubDate>Tue, 27 May 2014 10:32:19 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Basics]]></category>
		<category><![CDATA[categories]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[prestashop 101]]></category>
		<category><![CDATA[products]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=613</guid>
		<description><![CDATA[<p>Prestashop 101 series is a great resource for who wants to learn more about this fantastic e-commerce software. In day three we will have an extensive look at Prestashop categories and products. Running time:  34mins / 41 mins Prestashop version: 1.6.0.6 / 1.5.1 Watch the screencast &#8211; 1.6 version Watch the screencast &#8211; 1.5 version [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-categories-and-products/">Prestashop 101 Day 3 &#8211; Categories and products</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Prestashop 101 series is a great resource for who wants to learn more about this fantastic e-commerce software. In day three we will have an extensive look at Prestashop categories and products.<span id="more-613"></span></p>
<p><a class="download-files button style1" href="http://nemops.com/wp-content/uploads/2012/10/prestashop_101_day3.rar" title="Download Project Files">Download Project Files</a><br />
<strong>Running time: </strong> 34mins / 41 mins</p>
<p><strong>Prestashop version:</strong> 1.6.0.6 / 1.5.1</p>
<div class="separator"></div>
<h2>Watch the screencast &#8211; 1.6 version</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/k1j_N9pG9qo#038;feature=youtu.be" frameborder="0" allowfullscreen></iframe><p><a href="https://www.youtube.com/user/NemoPostScriptum/videos" rel="nofollow" title="Subscribe Post Scriptum's Youtube Channel">Subscribe Post Scriptum's Youtube Channel</a></p>	</div>
<h2>Watch the screencast &#8211; 1.5 version</h2>
<p>
	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/3U-DOE38LOQ" frameborder="0" allowfullscreen></iframe><p><a href="https://www.youtube.com/user/NemoPostScriptum/videos" rel="nofollow" title="Subscribe Post Scriptum's Youtube Channel">Subscribe Post Scriptum's Youtube Channel</a></p>	</div><br />
&nbsp;</p>
<p><strong>Note:</strong> In the rush of finishing the video (1.5) before reaching 50 mins, I accidentally forgot to add a quantity for the product (that&#8217;s why the &#8220;add to cart&#8221; is greyed out). To do it, go back to the product page, quantities tab, and add the quantity you want in the quantity field. At any rate, I&#8217;ll do it in the next video.</p>
<h3>All series&#8217; lessons</h3>
<h3>Prestashop 1.6</h3>
<ul><li><a href="http://nemops.com/prestashop-101-day-1-installing-prestashop" title="Prestashop 101 Day 1 – Introducing and installing Prestashop">Prestashop 101 Day 1 – Introducing and installing Prestashop</a></li><li><a href="http://nemops.com/prestashop-101-prestashop-configuration" title="Prestashop 101 Day 2 – Basic Prestashop Configuration">Prestashop 101 Day 2 – Basic Prestashop Configuration</a></li><li>Prestashop 101 Day 3 – Prestashop categories and products</li><li><a href="http://nemops.com/prestashop-attributes" title="Prestashop 101 Day 4 – Prestashop attributes combinations">Prestashop 101 Day 4 – Prestashop attributes combinations</a></li><li><a href="http://nemops.com/prestashop-upgrade" title="Prestashop 101 Day 5 – Prestashop Upgrade">Prestashop 101 Day 5 – Prestashop Upgrade</a></li><li><a href="http://nemops.com/prestashop-modules" title="Prestashop 101 Day 6 – Prestashop Modules">Prestashop 101 Day 6 – Prestashop Modules</a></li><li><a href="http://nemops.com/prestashop-shipping-zones-countries" title="Prestashop 101 Day 7 – Prestashop Shipping, Zones and Countries">Prestashop 101 Day 7 – Prestashop Shipping, Zones and Countries</a></li><li><a href="http://nemops.com/prestashop-payments-currencies-taxes" title="Prestashop 101 Day 8 – Taxes, Currencies, Payments">Prestashop 101 Day 8 – Taxes, Currencies, Payments</a></li><li><a href="http://nemops.com/order-management" title="Prestashop 101 Day 9 – Order Management">Prestashop 101 Day 9 – Order Management</a></li><li><a href="http://nemops.com/prestashop-customers" title="Prestashop 101 Day 10 – Prestashop Customers">Prestashop 101 Day 10 – Prestashop Customers</a></li><li><a href="http://nemops.com/prestashop-discounts-cart-rules" title="Prestashop 101 Day 11 – Prestashop Discounts (Cart rules)">Prestashop 101 Day 11 – Prestashop Discounts (Cart rules)</a></li></ul>
<h3>Prestashop 1.5</h3>
<ul><li><a href="http://nemops.com/prestashop-101-day-1-installing-prestashop" title="Prestashop 101 Day 1 – Introducing and installing Prestashop">Prestashop 101 Day 1 – Introducing and installing Prestashop</a></li><li><a href="http://nemops.com/prestashop-101-prestashop-configuration" title="Prestashop 101 Day 2 – Basic Prestashop Configuration">Prestashop 101 Day 2 – Basic Prestashop Configuration</a></li><li>Prestashop 101 Day 3 – Prestashop categories and products</li><li><a href="http://nemops.com/prestashop-attributes" title="Prestashop 101 Day 4 – Prestashop attributes combinations">Prestashop 101 Day 4 – Prestashop attributes combinations</a></li><li><a href="http://nemops.com/prestashop-upgrade" title="Prestashop 101 Day 5 – Prestashop Upgrade">Prestashop 101 Day 5 – Prestashop Upgrade</a></li><li><a href="http://nemops.com/prestashop-modules" title="Prestashop 101 Day 6 – Prestashop Modules">Prestashop 101 Day 6 – Prestashop Modules</a></li><li><a href="http://nemops.com/prestashop-shipping-zones-countries" title="Prestashop 101 Day 7 – Prestashop Shipping, Zones and Countries">Prestashop 101 Day 7 – Prestashop Shipping, Zones and Countries</a></li><li><a href="http://nemops.com/prestashop-payments-currencies-taxes" title="Prestashop 101 Day 8 – Taxes, Currencies, Payments">Prestashop 101 Day 8 – Taxes, Currencies, Payments</a></li><li><a href="http://nemops.com/order-management" title="Prestashop 101 Day 9 – Order Management">Prestashop 101 Day 9 – Order Management</a></li><li><a href="http://nemops.com/prestashop-customers" title="Prestashop 101 Day 10 – Prestashop Customers">Prestashop 101 Day 10 – Prestashop Customers</a></li><li><a href="http://nemops.com/prestashop-discounts-cart-rules" title="Prestashop 101 Day 11 – Prestashop Discounts (Cart rules)">Prestashop 101 Day 11 – Prestashop Discounts (Cart rules)</a></li><li><a href="http://nemops.com/prestashop-themes" title="Prestashop 101 Day 12 – Prestashop Themes and visual tweaks">Prestashop 101 Day 12 – Prestashop Themes and visual tweaks</a></li><li><a href="http://nemops.com/prestashop-cms" title="Prestashop 101 Day 13 – Prestashop CMS">Prestashop 101 Day 13 – Prestashop CMS</a></li><li><a href="http://nemops.com/prestashop-seo-and-preferences" title="Prestashop 101 Day 14 – Prestashop SEO and Preferences">Prestashop 101 Day 14 – Prestashop SEO and Preferences</a></li><li><a href="http://nemops.com/prestashop-multistore" title="Prestashop 101 Day 15 – Prestashop Multistore">Prestashop 101 Day 15 – Prestashop Multistore</a></li><li><a href="http://nemops.com/prestashop-employees-and-languages/#.U2f_LPna6r0" title="Prestashop 101 Day 16 – Employees and Languages">Prestashop 101 Day 16 – Employees and Languages</a></li></ul>
<div class="separator"></div>
<p>&nbsp;</p>
<h3>Additional Resources</h3>
<ul>
<li><a title="Prestashop documentation: managing Products" href="http://doc.prestashop.com/display/PS16/Managing+Products">Prestashop documentation: managing Products</a></li>
<li><a title="Download Prestashop 1.6" href="http://www.prestashop.com/en/download">Download Prestashop 1.6</a></li>
</ul>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-categories-and-products/">Prestashop 101 Day 3 &#8211; Categories and products</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://nemops.com/prestashop-categories-and-products/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Flash Tip: Move categories again in Prestashop&#8217;s back office</title>
		<link>https://nemops.com/move-prestashop-categories/</link>
		<comments>https://nemops.com/move-prestashop-categories/#comments</comments>
		<pubDate>Tue, 04 Mar 2014 10:41:10 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[arrows]]></category>
		<category><![CDATA[categories]]></category>
		<category><![CDATA[prestashop]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=1893</guid>
		<description><![CDATA[<p>In this flash tip we will see how to take the movement arrows back for the category list in the back office of Prestashop 1.5.6 and up Watch The screencast Text version If you just uploaded to a Prestashop version higher 1.5.6, you will have noticed you can&#8217;t move categories anymore from the back office. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://nemops.com/move-prestashop-categories/">Flash Tip: Move categories again in Prestashop&#8217;s back office</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In this flash tip we will see how to take the movement arrows back for the category list in the back office of Prestashop 1.5.6 and up</p>
<p><span id="more-1893"></span></p>
<h2>Watch The screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/QSVgG6DzB0c#038;feature=youtu.be" frameborder="0" allowfullscreen></iframe><p><a href="https://www.youtube.com/user/NemoPostScriptum/videos" rel="nofollow" title="Subscribe Post Scriptum's Youtube Channel">Subscribe Post Scriptum's Youtube Channel</a></p>	</div>
<div class="separator"></div>
<h2>Text version</h2>
<p>If you just uploaded to a Prestashop version higher 1.5.6, you will have noticed you can&#8217;t move categories anymore from the back office. Actually, this is only half true, you can move categories&#8230; if you do what Prestashop wants.</p>
<p><a href="http://nemops.com/wp-content/uploads/2014/03/Categories-PrestaShop™.png"><img src="http://nemops.com/wp-content/uploads/2014/03/Categories-PrestaShop™-680x298.png" alt="How to Move categories again in Prestashop&#039;s back office" width="680" height="298" class="aligncenter size-large wp-image-1898" /></a></p>
<p>By default, to make the shy arrows pop out, you have to <strong>sort by position ascendant</strong>, by clicking the button highlighted in the next picture. Boring, huh? If you hit rese,t they will vanish again.</p>
<p><a href="http://nemops.com/wp-content/uploads/2014/03/sortbypos.png"><img src="http://nemops.com/wp-content/uploads/2014/03/sortbypos.png" alt="Sort categories in Prestashop&#039;s Back Office" width="293" height="198" class="aligncenter size-full wp-image-1900" /></a></p>
<p>To take them back by default, we therefore need to tell Prestashop to sort by position (ascendant) if no sorting parameter is passed. Open up <strong>AdminCategoriesController</strong>, that you can find in <em>controllers/admin</em>. You can use an override if you prefer, I will go ahead and edit the core file. Locate&#8221;</p>
<pre class="brush: php; title: ; notranslate">
	public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
	{
		parent::getList($id_lang, $order_by, $order_way, $start, $limit, Context::getContext()-&gt;shop-&gt;id);
		// Check each row to see if there are combinations and get the correct action in consequence

		$nb_items = count($this-&gt;_list);
		for ($i = 0; $i &lt; $nb_items; $i++)
		{
			$item = &amp;$this-&gt;_list[$i];
			$category_tree = Category::getChildren((int)$item['id_category'], $this-&gt;context-&gt;language-&gt;id);
			if (!count($category_tree))
				$this-&gt;addRowActionSkipList('view', array($item['id_category']));
		}
	}
</pre>
<p>At the very beginning, add:</p>
<pre class="brush: php; title: ; notranslate">
	public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
	{
		if(!Tools::getValue('categoryOrderby'))
			$order_by = 'position';
		if(!Tools::getValue('categoryOrderway'))
			$order_way = 'asc';
	}
</pre>
<p><strong>Explanation:</strong> we are simply telling Prestashop to use order by position adcendant if no category order parameter is passed (aka: we didn&#8217;t click anything or tried to input any filter).</p>
<p>The final method:</p>
<pre class="brush: php; title: ; notranslate">
	public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
	{

		if(!Tools::getValue('categoryOrderby'))
			$order_by = 'position';
		if(!Tools::getValue('categoryOrderway'))
			$order_way = 'asc';

		parent::getList($id_lang, $order_by, $order_way, $start, $limit, Context::getContext()-&gt;shop-&gt;id);
		// Check each row to see if there are combinations and get the correct action in consequence

		$nb_items = count($this-&gt;_list);
		for ($i = 0; $i &lt; $nb_items; $i++)
		{
			$item = &amp;$this-&gt;_list[$i];
			$category_tree = Category::getChildren((int)$item['id_category'], $this-&gt;context-&gt;language-&gt;id);
			if (!count($category_tree))
				$this-&gt;addRowActionSkipList('view', array($item['id_category']));
		}
	}
</pre>
<p>Refresh the back office, reset all filters, and you will have the arrows back</p>
<p>The post <a rel="nofollow" href="https://nemops.com/move-prestashop-categories/">Flash Tip: Move categories again in Prestashop&#8217;s back office</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://nemops.com/move-prestashop-categories/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adding the visual editor to Category Description</title>
		<link>https://nemops.com/visual-editor-to-category-description/</link>
		<comments>https://nemops.com/visual-editor-to-category-description/#comments</comments>
		<pubDate>Wed, 17 Jul 2013 09:57:37 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[categories]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[prestashop]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=1415</guid>
		<description><![CDATA[<p>In this video and written quick tip, we will see how to add a visual editor to the category description in Presashop. The proper way, of course, so that changes will not be killed with the next Prestashop Upgrade! Watch The Screencast (text below) &#160; &#160; Adding the visual editor to category description the proper [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://nemops.com/visual-editor-to-category-description/">Adding the visual editor to Category Description</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In this video and written quick tip, we will see how to add a visual editor to the category description in Presashop. The proper way, of course, so that changes will not be killed with the next Prestashop Upgrade!</p>
<p><span id="more-1415"></span></p>
<a class="download-files button style1" href="http://nemops.com/wp-content/uploads/2013/07/AdminCategoriesController.zip" title="Download Project Files">Download Project Files</a>
<h2>Watch The Screencast (text below)</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/UZLHhr0DanM" frameborder="0" allowfullscreen></iframe><p><a href="https://www.youtube.com/user/NemoPostScriptum/videos" rel="nofollow" title="Subscribe Post Scriptum's Youtube Channel">Subscribe Post Scriptum's Youtube Channel</a></p>	</div>
<div class="separator"></div>
<p>&nbsp;</p>
<h2>Adding the visual editor to category description the proper way</h2>
<p>Open up your Prestashop root folder, then navigate to <em>controllers/admin</em> and open <strong>AdminCategorisController.php</strong> in your favorite code editor.</p>
<p>Locate the <strong>renderForm</strong> method, at about line 321 (Prestashop 1.5.4.0). Inside it, locate the following snippet</p>
<pre class="brush: php; title: ; notranslate">
				array(
					'type' =&gt; 'textarea',
					'label' =&gt; $this-&gt;l('Description:'),
					'name' =&gt; 'description',
					'lang' =&gt; true,
					'rows' =&gt; 10,
					'cols' =&gt; 100,
					'hint' =&gt; $this-&gt;l('Invalid characters:').' &lt;&gt;;=#{}',
				),
</pre>
<p>Change so it looks like this:</p>
<pre class="brush: php; title: ; notranslate">
				array(
					'type' =&gt; 'textarea',
					'label' =&gt; $this-&gt;l('Description:'),
					'name' =&gt; 'description',
					'lang' =&gt; true,
					'rows' =&gt; 10,
					'cols' =&gt; 100,
					'hint' =&gt; $this-&gt;l('Invalid characters:').' &lt;&gt;;=#{}',
					'autoload_rte' =&gt; true
				),
</pre>
<p>As you can see <strong>we have added &#8216;autoload_rte&#8217; => true</strong>. This enables the visual editor. Save and access a category page in the back office to see the visual editor.</p>
<p>However, this way your changes will inevitably be overrridden at the next prestashop update you do. We need to use an <strong>override</strong>.</p>
<h3>Using an override for the controller</h3>
<p>Back to your prestashop root, go to <em>override/controllers/admin</em> and create a file called <strong>AdminCategorisController.php</strong>. Paste the following snippet inside</p>
<p>Change so it looks like this:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

Class AdminCategoriesController extends AdminCategoriesControllerCore
{

?&gt;
</pre>
<p><strong>Note:</strong> We are extending a prestashop class (controller in this case). If you want to know more about this, head over <a href="http://doc.prestashop.com/display/PS15/Overriding+default+behaviors#Overridingdefaultbehaviors-OverridingPrestaShop'sclassesandcontrollers" title="Overriding Classes and Controllers in Prestashop">here</a>.</p>
<p>In the <strong>original</strong> AdminCategoriesController, copy the whole renderForm function we just modified, and paste it inside our new override.</p>
<p>Okay, at this point you might notice that the method is calling <strong>parent::renderForm();</strong> at the end, right before the closing bracket. Therefore, change the following line</p>
<pre class="brush: php; title: ; notranslate">
return parent::renderForm();
</pre>
<p>to</p>
<pre class="brush: php; title: ; notranslate">
return AdminController::renderForm();
</pre>
<p><strong>Tip:</strong> if we didn&#8217;t do this, the original one would have overridden this one no matter what, and no changes would have taken place</p>
<p>Lastly, head over to the root folder again then <em>cache/</em> and delete the <strong>class_index.php</strong> file, so that our changes take place. At this point, you can also restore the original adminCategoriesController to its defaults, since we are extending it in a maintainable way.</p>
<p>Here is the complete override (you can download it as a project file)</p>
<p>&#8230;And! if you would like more freedom with the visual editor, or simply <strong>the possibility to add html / javascript / css content everywhere in Prestashop/s front office</strong>, have a look at my module <a href="http://store.nemops.com/modules/28-html-block.html">HTML Block!</a></p>
<pre class="brush: php; title: ; notranslate">

&lt;?php

Class AdminCategoriesController extends AdminCategoriesControllerCore
{
	public function renderForm()
	{
		$this-&gt;initToolbar();
		$obj = $this-&gt;loadObject(true);
		$id_shop = Context::getContext()-&gt;shop-&gt;id;
		$selected_cat = array((isset($obj-&gt;id_parent) &amp;&amp; $obj-&gt;isParentCategoryAvailable($id_shop))? (int)$obj-&gt;id_parent : (int)Tools::getValue('id_parent', Category::getRootCategory()-&gt;id));
		$unidentified = new Group(Configuration::get('PS_UNIDENTIFIED_GROUP'));
		$guest = new Group(Configuration::get('PS_GUEST_GROUP'));
		$default = new Group(Configuration::get('PS_CUSTOMER_GROUP'));

		$unidentified_group_information = sprintf($this-&gt;l('%s - All people without a valid customer account.'), '&lt;b&gt;'.$unidentified-&gt;name[$this-&gt;context-&gt;language-&gt;id].'&lt;/b&gt;');
		$guest_group_information = sprintf($this-&gt;l('%s - Customer who placed an order with the guest checkout.'), '&lt;b&gt;'.$guest-&gt;name[$this-&gt;context-&gt;language-&gt;id].'&lt;/b&gt;');
		$default_group_information = sprintf($this-&gt;l('%s - All people who have created an account on this site.'), '&lt;b&gt;'.$default-&gt;name[$this-&gt;context-&gt;language-&gt;id].'&lt;/b&gt;');
		$root_category = Category::getRootCategory();
		$root_category = array('id_category' =&gt; $root_category-&gt;id, 'name' =&gt; $root_category-&gt;name);
		$this-&gt;fields_form = array(
			'tinymce' =&gt; true,
			'legend' =&gt; array(
				'title' =&gt; $this-&gt;l('Category'),
				'image' =&gt; '../img/admin/tab-categories.gif'
			),
			'input' =&gt; array(
				array(
					'type' =&gt; 'text',
					'label' =&gt; $this-&gt;l('Name:'),
					'name' =&gt; 'name',
					'lang' =&gt; true,
					'size' =&gt; 48,
					'required' =&gt; true,
					'class' =&gt; 'copy2friendlyUrl',
					'hint' =&gt; $this-&gt;l('Invalid characters:').' &lt;&gt;;=#{}',
				),
				array(
					'type' =&gt; 'radio',
					'label' =&gt; $this-&gt;l('Displayed:'),
					'name' =&gt; 'active',
					'required' =&gt; false,
					'class' =&gt; 't',
					'is_bool' =&gt; true,
					'values' =&gt; array(
						array(
							'id' =&gt; 'active_on',
							'value' =&gt; 1,
							'label' =&gt; $this-&gt;l('Enabled')
						),
						array(
							'id' =&gt; 'active_off',
							'value' =&gt; 0,
							'label' =&gt; $this-&gt;l('Disabled')
						)
					)
				),
				array(
					'type' =&gt; 'categories',
					'label' =&gt; $this-&gt;l('Parent category:'),
					'name' =&gt; 'id_parent',
					'values' =&gt; array(
						'trads' =&gt; array(
							 'Root' =&gt; $root_category,
							 'selected' =&gt; $this-&gt;l('Selected'),
							 'Collapse All' =&gt; $this-&gt;l('Collapse All'),
							 'Expand All' =&gt; $this-&gt;l('Expand All')
						),
						'selected_cat' =&gt; $selected_cat,
						'input_name' =&gt; 'id_parent',
						'use_radio' =&gt; true,
						'use_search' =&gt; false,
						'disabled_categories' =&gt; array(4),
						'top_category' =&gt; Category::getTopCategory(),
						'use_context' =&gt; true,
					)
				),
				array(
					'type' =&gt; 'radio',
					'label' =&gt; $this-&gt;l('Root Category:'),
					'name' =&gt; 'is_root_category',
					'required' =&gt; false,
					'is_bool' =&gt; true,
					'class' =&gt; 't',
					'values' =&gt; array(
						array(
							'id' =&gt; 'is_root_on',
							'value' =&gt; 1,
							'label' =&gt; $this-&gt;l('Yes')
						),
						array(
							'id' =&gt; 'is_root_off',
							'value' =&gt; 0,
							'label' =&gt; $this-&gt;l('No')
						)
					)
				),
				array(
					'type' =&gt; 'textarea',
					'label' =&gt; $this-&gt;l('Description:'),
					'name' =&gt; 'description',
					'lang' =&gt; true,
					'rows' =&gt; 10,
					'cols' =&gt; 100,
					'hint' =&gt; $this-&gt;l('Invalid characters:').' &lt;&gt;;=#{}',
					'autoload_rte' =&gt; true
				),
				array(
					'type' =&gt; 'file',
					'label' =&gt; $this-&gt;l('Image:'),
					'name' =&gt; 'image',
					'display_image' =&gt; true,
					'desc' =&gt; $this-&gt;l('Upload a category logo from your computer.')
				),
				array(
					'type' =&gt; 'text',
					'label' =&gt; $this-&gt;l('Meta title:'),
					'name' =&gt; 'meta_title',
					'lang' =&gt; true,
					'hint' =&gt; $this-&gt;l('Forbidden characters:').' &lt;&gt;;=#{}'
				),
				array(
					'type' =&gt; 'text',
					'label' =&gt; $this-&gt;l('Meta description:'),
					'name' =&gt; 'meta_description',
					'lang' =&gt; true,
					'hint' =&gt; $this-&gt;l('Forbidden characters:').' &lt;&gt;;=#{}'
				),
				array(
					'type' =&gt; 'tags',
					'label' =&gt; $this-&gt;l('Meta keywords:'),
					'name' =&gt; 'meta_keywords',
					'lang' =&gt; true,
					'hint' =&gt; $this-&gt;l('Forbidden characters:').' &lt;&gt;;=#{}',
					'desc' =&gt; $this-&gt;l('To add &quot;tags,&quot; click in the field, write something, and then press &quot;Enter.&quot;')
				),
				array(
					'type' =&gt; 'text',
					'label' =&gt; $this-&gt;l('Friendly URL:'),
					'name' =&gt; 'link_rewrite',
					'lang' =&gt; true,
					'required' =&gt; true,
					'hint' =&gt; $this-&gt;l('Only letters and the minus (-) character are allowed.')
				),
				array(
					'type' =&gt; 'group',
					'label' =&gt; $this-&gt;l('Group access:'),
					'name' =&gt; 'groupBox',
					'values' =&gt; Group::getGroups(Context::getContext()-&gt;language-&gt;id),
					'info_introduction' =&gt; $this-&gt;l('You now have three default customer groups.'),
					'unidentified' =&gt; $unidentified_group_information,
					'guest' =&gt; $guest_group_information,
					'customer' =&gt; $default_group_information,
					'desc' =&gt; $this-&gt;l('Mark all of the customer groups you;d like to have access to this category.')
				)
			),
			'submit' =&gt; array(
				'title' =&gt; $this-&gt;l('Save'),
				'class' =&gt; 'button'
			)
		);
		
		$this-&gt;tpl_form_vars['shared_category'] = Validate::isLoadedObject($obj) &amp;&amp; $obj-&gt;hasMultishopEntries(); 
		$this-&gt;tpl_form_vars['PS_ALLOW_ACCENTED_CHARS_URL'] = (int)Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL');
		if (Shop::isFeatureActive())
			$this-&gt;fields_form['input'][] = array(
				'type' =&gt; 'shop',
				'label' =&gt; $this-&gt;l('Shop association:'),
				'name' =&gt; 'checkBoxShopAsso',
			);
		// remove category tree and radio button &quot;is_root_category&quot; if this category has the root category as parent category to avoid any conflict
		if ($this-&gt;_category-&gt;id_parent == Category::getTopCategory()-&gt;id &amp;&amp; Tools::isSubmit('updatecategory'))
			foreach ($this-&gt;fields_form['input'] as $k =&gt; $input)
				if (in_array($input['name'], array('id_parent', 'is_root_category')))
					unset($this-&gt;fields_form['input'][$k]);

		if (Tools::isSubmit('add'.$this-&gt;table.'root'))
			unset($this-&gt;fields_form['input'][2],$this-&gt;fields_form['input'][3]);

		if (!($obj = $this-&gt;loadObject(true)))
			return;

		$image = ImageManager::thumbnail(_PS_CAT_IMG_DIR_.'/'.$obj-&gt;id.'.jpg', $this-&gt;table.'_'.(int)$obj-&gt;id.'.'.$this-&gt;imageType, 350, $this-&gt;imageType, true);

		$this-&gt;fields_value = array(
			'image' =&gt; $image ? $image : false,
			'size' =&gt; $image ? filesize(_PS_CAT_IMG_DIR_.'/'.$obj-&gt;id.'.jpg') / 1000 : false
		);

		// Added values of object Group
		$category_groups_ids = $obj-&gt;getGroups();

		$groups = Group::getGroups($this-&gt;context-&gt;language-&gt;id);
		// if empty $carrier_groups_ids : object creation : we set the default groups
		if (empty($category_groups_ids))
		{
			$preselected = array(Configuration::get('PS_UNIDENTIFIED_GROUP'), Configuration::get('PS_GUEST_GROUP'), Configuration::get('PS_CUSTOMER_GROUP'));
			$category_groups_ids = array_merge($category_groups_ids, $preselected);
		}
		foreach ($groups as $group)
			$this-&gt;fields_value['groupBox_'.$group['id_group']] = Tools::getValue('groupBox_'.$group['id_group'], (in_array($group['id_group'], $category_groups_ids)));

		return AdminController::renderForm();
	}	
}
</pre>
<p>The post <a rel="nofollow" href="https://nemops.com/visual-editor-to-category-description/">Adding the visual editor to Category Description</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://nemops.com/visual-editor-to-category-description/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
