<?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; carriers</title>
	<atom:link href="http://nemops.com/tag/carriers/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>Duplicating Carriers along with Products in PrestaShop and ThirtyBees</title>
		<link>http://nemops.com/prestashop-thirtybees-duplicate-product-carriers/</link>
		<comments>http://nemops.com/prestashop-thirtybees-duplicate-product-carriers/#comments</comments>
		<pubDate>Mon, 13 Nov 2017 12:54:03 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[carriers]]></category>
		<category><![CDATA[duplicate]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[thirtybees]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=3090</guid>
		<description><![CDATA[<p>In this tutorial we will use a little code snippet to have carriers copy over on product duplication in PrestaShop and Thirtybees. Watch the screencast Duplicating product carriers in PrestaShop and ThirtyBees &#8211; text version Create a new override in override/controllers/admin, and name it AdminProductsController.php: We need to copy the original ProcessDuplicate method, and paste [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://nemops.com/prestashop-thirtybees-duplicate-product-carriers/">Duplicating Carriers along with Products in PrestaShop and ThirtyBees</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In this tutorial we will use a little code snippet to have carriers copy over on product duplication in PrestaShop and Thirtybees.</p>
<p><span id="more-3090"></span></p>
<h2>Watch the screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/SZfVTkEDjb4" 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>Duplicating product carriers in PrestaShop and ThirtyBees &#8211; text version</h2>
<p>Create a new override in <em>override/controllers/admin</em>, and name it <strong>AdminProductsController.php</strong>:</p>
<pre class="brush: php; title: ; notranslate">
class AdminProductsController extends AdminProductsControllerCore
{
}
</pre>
<p>We need to copy the original <strong>ProcessDuplicate</strong> method, and paste it into our override. You will see it&#8217;s calling a bunch of methods that start with &#8220;duplicate&#8221;. Add the following right after Product::duplicateSuppliers($id_product_old, $product->id):</p>
<pre class="brush: php; title: ; notranslate">
            &amp;&amp; Product::duplicateCarriers($id_product_old, $product-&gt;id)
</pre>
<p>Next, we have to add the method we are calling to the Product class. We will use another override, so let&#8217;s create <strong>Product.php</strong> in <em>override/classes</em></p>
<p>Open it up, and paste the following, or if you have a product override already in place, just copy over the <strong>DuplicateCarriers</strong> method:</p>
<pre class="brush: php; title: ; notranslate">
    public static function duplicateCarriers($id_product_old, $id_product_new)
    {
        $result = Db::getInstance()-&gt;executeS('
		SELECT *
		FROM `'._DB_PREFIX_.'product_carrier`
		WHERE `id_product` = '.(int)$id_product_old);

        foreach ($result as $row) {
            unset($row['id_product_carrier']);
            $row['id_product'] = $id_product_new;
            if (!Db::getInstance()-&gt;insert('product_carrier', $row)) {
                return false;
            }
        }

        return true;
    }	
</pre>
<p>Save, then reach the <em>cache/</em> folder and erase <strong>class_index.php</strong>, so that the new overrides can get loaded in the system.</p>
<p>The post <a rel="nofollow" href="http://nemops.com/prestashop-thirtybees-duplicate-product-carriers/">Duplicating Carriers along with Products in PrestaShop and ThirtyBees</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/prestashop-thirtybees-duplicate-product-carriers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Limiting payment methods to specific carriers in PrestaShop</title>
		<link>http://nemops.com/prestashop-payment-methods-specific-carriers/</link>
		<comments>http://nemops.com/prestashop-payment-methods-specific-carriers/#comments</comments>
		<pubDate>Thu, 16 Jun 2016 09:35:22 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[carriers]]></category>
		<category><![CDATA[payments]]></category>
		<category><![CDATA[prestashop]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=2790</guid>
		<description><![CDATA[<p>If you want to hide or display certain payment methods for specific carriers you have, here is a little trick on how to do it quickly. Upgrade-safe procedure Whenever you want to limit a payment method by carrier, you will necessarily need to edit the module&#8217;s hookPayment method. This means you will need to do [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://nemops.com/prestashop-payment-methods-specific-carriers/">Limiting payment methods to specific carriers in PrestaShop</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>If you want to hide or display certain payment methods for specific carriers you have, here is a little trick on how to do it quickly.<br />
<span id="more-2790"></span></p>
<h2>Upgrade-safe procedure</h2>
<p>Whenever you want to limit a payment method by carrier, you will necessarily need to edit the module&#8217;s <strong>hookPayment</strong> method. This means you will need to do it for every single payment method your shop has. However, if you amend the core file, changes will be lost on the next update of the module itself. If you are running a version newer than PrestaShop 1.6.0.11, you can <a href="http://nemops.com/override-prestashop-modules-core/" title="Override Modules Files">Override Modules Files</a> and make your life easier. This is actually what we are going to do in the tutorial.</p>
<p><strong>Notice: if you use an older PrestaShop version, you can simply modify the core file</strong></p>
<p>Additionally, there is an important thing we need to be aware of, whenever dealing with carriers. <strong>Carrier IDs will change anytime you update a carrier&#8217;s information</strong>, so we cannot use the ID as our static factor to check against to.</p>
<div class="separator"></div>
<h2>Overriding the Bankwire Module</h2>
<p>In this example, we will use the Bankwire module and limit it to a single carrier. The first thing we want to do is override it, so let&#8217;s create a new folder in <em>override/modules</em> and name it <strong>bankwire</strong>. Inside it, create a new file named <strong>bankwire.php</strong>, adding the following code inside php tags:</p>
<pre class="brush: php; title: ; notranslate">
if (!defined('_CAN_LOAD_FILES_'))
    exit;
 
class BankwireOverride extends Bankwire
{
 
 
}
</pre>
<p>Then reach your <em>cache</em> folder, and erase class_index.php. This will make sure our new override is loaded.<br />
Next, we want to extend the <strong>hookPayment</strong> method, which I will simply copy/paste from the original file</p>
<pre class="brush: php; title: ; notranslate">
if (!defined('_CAN_LOAD_FILES_'))
    exit;
 
class BankwireOverride extends Bankwire
{
 
 	public function hookPayment($params)
	{
		if (!$this-&gt;active)
			return;
		if (!$this-&gt;checkCurrency($params['cart']))
			return;

		$this-&gt;smarty-&gt;assign(array(
			'this_path' =&gt; $this-&gt;_path,
			'this_path_bw' =&gt; $this-&gt;_path,
			'this_path_ssl' =&gt; Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this-&gt;name.'/'
		));
		return $this-&gt;display(__FILE__, 'payment.tpl');
	}
}
</pre>
<p>At this point, we need our condition. First, I need to know which carrier I want to disable or enable the module for. I have a FedEx carrier that currently has ID 3, so I can temporarily use this information to get the real one I need.<br />
Reach your front office, with a product in the cart, and make sure the 5-steps checkout is enabled. Continue until the payment page, making sure you select the carrier you want to target beforehand.<br />
In our override, at the very beginning of the hookPayment method, let&#8217;s print out some debug code:</p>
<pre class="brush: php; title: ; notranslate">
...
 	public function hookPayment($params)
	{

		d($params['cart']-&gt;id_carrier);
		if (!$this-&gt;active)
			return;
		if (!$this-&gt;checkCurrency($params['cart']))
			return;
...
</pre>
<p>Refresh the payments list, and it will result in a blank page only reading an ID, followed by &#8220;END&#8221;<br />
That&#8217;s the ID of the carrier we selected. As mentioned at the beginning of the article, we cannot use it as static parameter, so <strong>we need to find the static id of this carrier</strong>.<br />
let&#8217;s play with the carrier object a bit:</p>
<pre class="brush: php; title: ; notranslate">
...
 	public function hookPayment($params)
	{

		$id_carrier = $params['cart']-&gt;id_carrier;
		$carrier = new Carrier($id_carrier);
		d($carrier);
		if (!$this-&gt;active)
			return;
		if (!$this-&gt;checkCurrency($params['cart']))
			return;
...
</pre>
<p>You will see a bunch of information as soon as you refresh. What we are interested in is the <strong>id_reference</strong> field of the carrier. This reference will never change, unlike the id_carrier, that will instead increase each time we save carrier information in the back office. Therefore, we can use this reference as our static field to check the payment method&#8217;s availability.</p>
<p>I want to disable bankwire for this carrier, so I will simply add:</p>
<pre class="brush: php; title: ; notranslate">
...
 	public function hookPayment($params)
	{

		$id_carrier = $params['cart']-&gt;id_carrier;
		$carrier = new Carrier($id_carrier);
		if($carrier-&gt;id_reference == 3) // my fedex, make sure your matches the carrier you use
			return false;
		if (!$this-&gt;active)
			return;
		if (!$this-&gt;checkCurrency($params['cart']))
			return;
...
</pre>
<p>As simple as that! On the other hand, if I want to enable bankwire for this carrier only, I can reverse the condition</p>
<pre class="brush: php; title: ; notranslate">
...
 	public function hookPayment($params)
	{

		$id_carrier = $params['cart']-&gt;id_carrier;
		$carrier = new Carrier($id_carrier);
		if($carrier-&gt;id_reference != 3) // my fedex, make sure your matches the carrier you use
			return false;
		if (!$this-&gt;active)
			return;
		if (!$this-&gt;checkCurrency($params['cart']))
			return;
...
</pre>
<p>The post <a rel="nofollow" href="http://nemops.com/prestashop-payment-methods-specific-carriers/">Limiting payment methods to specific carriers in PrestaShop</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/prestashop-payment-methods-specific-carriers/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Free PrestaShop Module available: Carrier Assigner</title>
		<link>http://nemops.com/free-prestashop-module-carrier-assigner/</link>
		<comments>http://nemops.com/free-prestashop-module-carrier-assigner/#comments</comments>
		<pubDate>Wed, 27 Jan 2016 10:24:28 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[carriers]]></category>
		<category><![CDATA[free module]]></category>
		<category><![CDATA[prestashop]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=2693</guid>
		<description><![CDATA[<p>This module has been specifically designed to help you assign carriers to products in bulk. And it&#8217;s completely FREE! Assigning specific carriers to products is a long and cumbersome process, but this Free PrestaShop module lets you do it in a single click for whole categories or chosen product lists. You can select two different [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://nemops.com/free-prestashop-module-carrier-assigner/">Free PrestaShop Module available: Carrier Assigner</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>This module has been specifically designed to help you assign carriers to products in bulk. And it&#8217;s completely FREE!</p>
<p><span id="more-2693"></span></p>
<p>Assigning specific carriers to products is a long and cumbersome process, but this Free PrestaShop module lets you do it in a single click for whole categories or chosen product lists.<br />
You can select two different input modes (by category or direct input of a comma-separated list of IDs), the carrier, hit assign, and you are done!  Take the work of hours down to a couple of minutes! </p>
<p><a href="http://store.nemops.com/free-modules/43-carrier-assigner-free-module.html#.VqiZ8_k4Hmg" title="Get it here!" class="button style1">Get it here!</a></p>
<h2>Watch the screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/rozL-O1jx5k" 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="http://nemops.com/free-prestashop-module-carrier-assigner/">Free PrestaShop Module available: Carrier Assigner</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/free-prestashop-module-carrier-assigner/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Prestashop 1.5.5 : The new Carrier Creation Wizard</title>
		<link>http://nemops.com/prestashop-carrier-creation-wizard/</link>
		<comments>http://nemops.com/prestashop-carrier-creation-wizard/#comments</comments>
		<pubDate>Mon, 02 Sep 2013 10:25:39 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[carriers]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[shipping]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=1526</guid>
		<description><![CDATA[<p>Prestashop 1.5.5 came out last week with a nice tasty addition: a carrier Creation wizard that finally gets rid of the confusing old carrier creation process! Let&#8217;s have a first look at it! Watch The Screencast &#160;</p>
<p>The post <a rel="nofollow" href="http://nemops.com/prestashop-carrier-creation-wizard/">Prestashop 1.5.5 : The new Carrier Creation Wizard</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Prestashop 1.5.5 came out last week with a nice tasty addition: a carrier Creation wizard that finally gets rid of the confusing old carrier creation process! Let&#8217;s have a first look at it!</p>
<p><span id="more-1526"></span></p>
<h2>Watch The Screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/dYR4jOW_VQY" 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="http://nemops.com/prestashop-carrier-creation-wizard/">Prestashop 1.5.5 : The new Carrier Creation Wizard</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/prestashop-carrier-creation-wizard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
