<?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; return</title>
	<atom:link href="https://nemops.com/tag/return/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>Mark orders with returned products in the order list of ThirtyBees and PrestaShop</title>
		<link>https://nemops.com/thirtybees-prestashop-mark-returned-orders/</link>
		<comments>https://nemops.com/thirtybees-prestashop-mark-returned-orders/#comments</comments>
		<pubDate>Mon, 02 Oct 2017 10:34:33 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[orders]]></category>
		<category><![CDATA[prestashop 1.6]]></category>
		<category><![CDATA[products]]></category>
		<category><![CDATA[return]]></category>
		<category><![CDATA[thirtybees]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=3085</guid>
		<description><![CDATA[<p>In this video for ThirtyBees and Prestashop 1.6, we will see how to add a checkmark for orders that contain returned products, so that they are easy to spot in the back office order list Watch the screencast Text Version All of the modifications need to be applied to AdminOrdersController.php, located in controllers/admin Add to [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://nemops.com/thirtybees-prestashop-mark-returned-orders/">Mark orders with returned products in the order list of ThirtyBees and PrestaShop</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In this video for ThirtyBees and Prestashop 1.6, we will see how to add a checkmark for orders that contain returned products, so that they are easy to spot in the back office order list<br />
<span id="more-3085"></span></p>
<h2>Watch the screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/fpuJEs8oo84" 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>Text Version</h2>
<p>All of the modifications need to be applied to <strong>AdminOrdersController.php</strong>, located in <em>controllers/admin</em><br />
Add to $this->_select (do not forget the comma!):</p>
<pre class="brush: php; title: ; notranslate">
od.product_quantity_return as has_returned,
</pre>
<p>Add to $this->_join:</p>
<pre class="brush: php; title: ; notranslate">
LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order` = a.`id_order`)
</pre>
<p>Right after the join variable is set, add:</p>
<pre class="brush: php; title: ; notranslate">
$this-&gt;_group = 'GROUP BY a.id_order';
</pre>
<p>This way we avoid duplicates in the order list.</p>
<p>In the next step we will add the actual column, scroll down to around line 130, and add the following to the $this->fields_list variable:</p>
<pre class="brush: php; title: ; notranslate">
                'has_returned'            =&gt; [
                    'title'      =&gt; $this-&gt;l('Return'),
                    'align'      =&gt; 'text-center',
                    'type'       =&gt; 'bool',
                    'callback'       =&gt; 'getIsReturned',
                ],
</pre>
<p>Lastly, out of the construct method (it can be anywhere, right after it or at the end of the file) we will add the callback function:</p>
<pre class="brush: php; title: ; notranslate">
    public function getIsReturned($a, $order)
    {
        $has_returned = Db::getInstance()-&gt;getValue('SELECT product_quantity_return FROM '._DB_PREFIX_.'order_detail WHERE id_order =' .(int)$order['id_order'] .' AND product_quantity_return &gt; 0');

        $class = $has_returned ? 'icon-check' : 'icon-remove';
        return '&lt;i class=&quot;'.$class.'&quot;&gt;&lt;/i&gt;';

    }
</pre>
<p>The post <a rel="nofollow" href="https://nemops.com/thirtybees-prestashop-mark-returned-orders/">Mark orders with returned products in the order list of ThirtyBees and PrestaShop</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://nemops.com/thirtybees-prestashop-mark-returned-orders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
