<?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; arrows</title>
	<atom:link href="http://nemops.com/tag/arrows/feed/" rel="self" type="application/rss+xml" />
	<link>http://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>Flash Tip: Move categories again in Prestashop&#8217;s back office</title>
		<link>http://nemops.com/move-prestashop-categories/</link>
		<comments>http://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="http://nemops.com/move-prestashop-categories/">Flash Tip: Move categories again in Prestashop&#8217;s back office</a> appeared first on <a rel="nofollow" href="http://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="http://nemops.com/move-prestashop-categories/">Flash Tip: Move categories again in Prestashop&#8217;s back office</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/move-prestashop-categories/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
