<?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</title>
	<atom:link href="http://nemops.com/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>Creating Multilanguage attachments in PrestaShop 1.7</title>
		<link>http://nemops.com/prestashop-1-7-multilanguage-attachments/</link>
		<comments>http://nemops.com/prestashop-1-7-multilanguage-attachments/#comments</comments>
		<pubDate>Wed, 05 Dec 2018 13:24:30 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[attachments]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[prestashop 1.7]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=3173</guid>
		<description><![CDATA[<p>Attachments are a great way to provide your customers with rich pre-sale information about your products. But what if your site is multilingual? Let’s see how to make Attachments multilanguage in PrestaShop 1.7. Watch the screencast Text Version Step 1 – Adding the attachments Adding attachments with the proper name is fundamental for this technique. [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://nemops.com/prestashop-1-7-multilanguage-attachments/">Creating Multilanguage attachments in PrestaShop 1.7</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Attachments are a great way to provide your customers with rich pre-sale information about your products. But what if your site is multilingual? Let’s see how to make Attachments multilanguage in PrestaShop 1.7.</p>
<p><span id="more-3173"></span></p>
<h2>Watch the screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/zoo6WkY7ouc" 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>
<h3>Step 1 – Adding the attachments</h3>
<p>Adding attachments with the proper name is fundamental for this technique. We will append the language ISOs to the names, so that they can later be targeted in the template.</p>
<p>Login to the back office, then navigate to Catalog &gt; Products, and choose one to start with. At the bottom of the <strong>Options </strong>tab, add two test attachments. The file names don’t matter, but the <strong>title </strong>you choose does. Add one attachment for each language it’s translated to, making sure you append the ISO code for that language after the name, like this: <strong>_en</strong>, <strong>_it</strong>, <strong>_fr</strong>.</p>
<p><strong>Note: </strong>If you don’t know what the language code is, hop to International &gt; Localization, and click on Languages. The ISO code is listed in the table:</p>
<p><a href="http://nemops.com/wp-content/uploads/2018/12/prestashop-17-language-iso.jpg"><img class="aligncenter size-full wp-image-3174" src="http://nemops.com/wp-content/uploads/2018/12/prestashop-17-language-iso.jpg" alt="PrestaShop 1.7 Language ISO" width="665" height="361" /></a></p>
<p>&nbsp;</p>
<p>If you need an attachment to display for all of the languages, make sure you <strong>do not</strong> add any language ISO to it.</p>
<div class="separator"></div>
<h3>Step 2 – Editing the template</h3>
<p>&nbsp;</p>
<p>For this tutorial I am using the “classic” template, that ships with PrestaShop 1.7. If you are using a custom theme, be aware that some of the code might be different, or even located in a different file.</p>
<p>Open up <strong>themes/classic/templates/catalog/product.tpl</strong>.</p>
<p>Locate the following code:</p>
<pre class="brush: php; html-script: true; title: ; notranslate">
{if $product.attachments}
                    &lt;div class=&quot;tab-pane fade in&quot; id=&quot;attachments&quot; role=&quot;tabpanel&quot;&gt;
                       &lt;section class=&quot;product-attachments&quot;&gt;
                         &lt;h3 class=&quot;h5 text-uppercase&quot;&gt;{l s='Download' d='Shop.Theme.Actions'}&lt;/h3&gt;
</pre>
<p>Right afterwards, but before the foreach loop, add the following</p>
<pre class="brush: php; html-script: true; title: ; notranslate">
{$lang_checker = &quot;_&quot;|cat: {$language.iso_code}}
{$lang_checker_array = ['en', 'it']}

</pre>
<p><strong>Make sure you use your own ISO codes instead of ‘en’ and ‘it’. Add all of the languages your store supports</strong></p>
<p>Next, wrap the attachment block in the following IF statement</p>
<pre class="brush: php; html-script: true; title: ; notranslate">
                         {if $attachment.name|strstr:{$lang_checker}}
                           &lt;div class=&quot;attachment&quot;&gt;
                             &lt;h4&gt;&lt;a href=&quot;{url entity='attachment' params=['id_attachment' =&gt; $attachment.id_attachment]}&quot;&gt;{$attachment.name|replace:{$lang_checker}:''}&lt;/a&gt;&lt;/h4&gt;
                             &lt;p&gt;{$attachment.description}&lt;/p
                             &lt;a href=&quot;{url entity='attachment' params=['id_attachment' =&gt; $attachment.id_attachment]}&quot;&gt;
                               {l s='Download' d='Shop.Theme.Actions'} ({$attachment.file_size_formatted})
                             &lt;/a&gt;
                           &lt;/div&gt;
{/if}

</pre>
<p>If you don’t need some attachments to display for all languages, you can go ahead and test it, as the basic part if basically done. If you do, you will need to add a little extra condition, and we will use that lang_checker_array for it.</p>
<div class="separator"></div>
<h3>Step 2.1 – Fallback for generic attachments</h3>
<p>Right before the end of the IF statement that checks for our ISO code, add the following:</p>
<pre class="brush: php; html-script: true; title: ; notranslate">

{else}
  {$denier = false}
  {foreach from=$lang_checker_array item=checkr_lang}
                              {if $attachment.name|strstr:{$checkr_lang}}
                              {$denier = true}
                              {/if}
  {/foreach}

</pre>
<p><strong>Explanation: </strong>We are setting a variable (denier) that will prevent displaying the attachment if it contains <strong>any</strong> language ISO. Because of this logic, make sure you use a string that’s unique enough in case your attachment names contain product codes or alike, otherwise they won’t ever display.</p>
<p>Right afterwards, but still inside our main IF, add this last chunk of code</p>
<pre class="brush: php; html-script: true; title: ; notranslate">
                               
{if !$denier}
&lt;div class=&quot;attachment&quot;&gt;
&lt;h4&gt;&lt;a href=&quot;{url entity='attachment' params=['id_attachment' =&gt; $attachment.id_attachment]}&quot;&gt;{$attachment.name|replace:{$lang_checker}:''}&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;{$attachment.description}&lt;/p
&lt;a href=&quot;{url entity='attachment' params=['id_attachment' =&gt; $attachment.id_attachment]}&quot;&gt;
{l s='Download' d='Shop.Theme.Actions'} ({$attachment.file_size_formatted})
&lt;/a&gt;
&lt;/div&gt;
{/if}

</pre>
<p>Which is basically a copy of the standard attachment code. If the attachment does not contain any iso code, it means we can display it normally.</p>
<p>We are done!</p>
<p>The post <a rel="nofollow" href="http://nemops.com/prestashop-1-7-multilanguage-attachments/">Creating Multilanguage attachments in PrestaShop 1.7</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/prestashop-1-7-multilanguage-attachments/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Removing out of stock products from the cart in PrestaShop 1.7</title>
		<link>http://nemops.com/remove-out-of-stock-products-from-the-cart-prestashop-17/</link>
		<comments>http://nemops.com/remove-out-of-stock-products-from-the-cart-prestashop-17/#comments</comments>
		<pubDate>Thu, 04 Oct 2018 00:08:07 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[out of stock]]></category>
		<category><![CDATA[prestashop 1.7]]></category>
		<category><![CDATA[products]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=3151</guid>
		<description><![CDATA[<p>PrestaShop 1.7 does not remove out of stock products from shopping carts, creating major troubles when keeping low stock. Let&#8217;s see how to improve our customer&#8217;s experience with a simple modification! Watch the screencast Text Version If you have lots of users it might happen sometimes that a product goes out of stock while it&#8217;s [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://nemops.com/remove-out-of-stock-products-from-the-cart-prestashop-17/">Removing out of stock products from the cart in PrestaShop 1.7</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>PrestaShop 1.7 does not remove out of stock products from shopping carts, creating major troubles when keeping low stock. Let&#8217;s see how to improve our customer&#8217;s experience with a simple modification!</p>
<h2>Watch the screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/OouTaCaMZBU" 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>If you have lots of users it might happen sometimes that a product goes out of stock while it&#8217;s in someone&#8217;s cart. For example two users add the last unit, one proceeds to the checkout and the other doesn&#8217;t. What happens is when the second customer places the order, the product will not be available anymore, and it will cause confusion if not irritation to that person, especially if you cannot restock that specific item.</p>
<h3>The Cart Presenter in PrestaShop 1.7</h3>
<p>The first file we need to edit is the <strong>cartPresenter</strong>, which is responsible of displaying cart information across the store.</p>
<p>Open up <em>src/Adapter/Cart/cartpresenter.php</em> and add the following around line 51, in the class properties:</p>
<pre class="brush: php; title: ; notranslate">
private static $removedProducts = [];
</pre>
<p>Then locate the <strong>present </strong>method, and right after the following statement:</p>
<pre class="brush: php; title: ; notranslate">
        if ($shouldSeparateGifts) {
            $rawProducts = $cart-&gt;getProductsWithSeparatedGifts();
        } else {
            $rawProducts = $cart-&gt;getProducts(true);
        }
</pre>
<p>Add this:</p>
<pre class="brush: php; title: ; notranslate">


        // start nemo

        if(!self::$removedProducts)
            foreach ($rawProducts as $pk =&gt; $product)
            {
            // we want to remove the product in case it's not available
                if($product['quantity_available'] &lt;= 0 &amp;&amp; !Product::isAvailableWhenOutOfStock($product['out_of_stock']))
                {
                    Context::getContext()-&gt;cart-&gt;deleteProduct($product['id_product'],$product['id_product_attribute'], $product['id_customization'], $product['id_address_delivery']);
                    self::$removedProducts[] = $product['name'];
                    unset($rawProducts[$pk]);
                    continue;
                }
            }
           
        Context::getContext()-&gt;smarty-&gt;assign(['removed_products' =&gt; self::$removedProducts]);
        \Media::addJsDef(['removed_products' =&gt; self::$removedProducts]);


</pre>
<p>And that&#8217;s all for php! Before continuing let&#8217;s make sure the product actually gets removed, so let&#8217;s test it and see if they really get removed!</p>
<h3>The shopping cart template in PrestaShop 1.7</h3>
<p>Let&#8217;s open up <em>themes/classic/modules/ps_shoppingcart/ps_shoppingcart.tpl </em></p>
<pre class="brush: php; html-script: true; title: ; notranslate">
{if isset($removed_products) &amp;&amp; $removed_products}
  &lt;div id=&quot;removed-modal&quot; class=&quot;modal&quot;&gt;
    &lt;div class=&quot;modal-dialog&quot;&gt;
      &lt;div class=&quot;modal-content&quot;&gt;
        &lt;div class=&quot;modal-body&quot;&gt;
          &lt;p&gt;{l s='These products are out of stock' d='Shop.Theme.Checkout'}&lt;/p&gt;
            &lt;ul&gt;
              {foreach from=$removed_products item='r_product'}
                &lt;li&gt;- {$r_product}&lt;/li&gt;
              {/foreach}
            &lt;/ul&gt;
            &lt;p&gt;{l s='And have therefore been removed from your cart' d='Shop.Theme.Checkout'}&lt;/p&gt;
        &lt;/div&gt;

      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
{/if}
</pre>
<p>And the very last thing is actually triggering the modal when we need, so let&#8217;s add some javascript to <em>themes/classic/assets/js/custom.js</em></p>
<pre class="brush: jscript; title: ; notranslate">
if(removed_products.length &gt; 0) {
	$('#removed-modal').modal('show');
}

</pre>
<p>And that&#8217;s it! Now this modal doesn&#8217;t look so fancy, but no worries since in one of the next videos we will go over creating and styling custom popups in prestashop 1.7, so stay tuned!</p>
<p>The post <a rel="nofollow" href="http://nemops.com/remove-out-of-stock-products-from-the-cart-prestashop-17/">Removing out of stock products from the cart in PrestaShop 1.7</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/remove-out-of-stock-products-from-the-cart-prestashop-17/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Blocking spam emails in PrestaShop</title>
		<link>http://nemops.com/blocking-spam-emails-in-prestashop/</link>
		<comments>http://nemops.com/blocking-spam-emails-in-prestashop/#comments</comments>
		<pubDate>Wed, 22 Aug 2018 02:11:43 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=3145</guid>
		<description><![CDATA[<p>As you know PrestaShop has been dreaded by a lot of spam issues recently. In this video we will see how to quickly block spam emails coming from the PrestaShop contact form Watch the screencast Let&#8217;s get started! Create a new php file in the override/controllers/front folder, and name it: ContactController.php and add the following [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://nemops.com/blocking-spam-emails-in-prestashop/">Blocking spam emails in PrestaShop</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>As you know PrestaShop has been dreaded by a lot of spam issues recently. In this video we will see how to quickly block spam emails coming from the PrestaShop contact form<br />
<span id="more-3145"></span></p>
<h2>Watch the screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/D3_gvr0Raww" 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>Let&#8217;s get started! Create a new php file in the <em>override/controllers/front</em> folder, and name it: <strong>ContactController.php</strong> and add the following inside php tags:</p>
<pre class="brush: php; title: ; notranslate">

class ContactController extends ContactControllerCore
{
}

</pre>
<p>We need to latch into the postProcess method, so let&#8217;s extend it:</p>
<pre class="brush: php; title: ; notranslate">
public function postProcess()
{
    if(Tools::isSubmit('submitMessage'))
    {
    }
}
</pre>
<p>We want to save the submitted message to a variable first, and then the email:</p>
<pre class="brush: php; title: ; notranslate">
    	$message = Tools::getValue('message');
        $from = trim(Tools::getValue('from'))
</pre>
<p>Now to keep things tidy we will create two new arrays, one will contain the list of strings to ban from emails, the other the ones to ban from the content:</p>
<pre class="brush: php; title: ; notranslate">

            $banned_in_email = ['.ru', 'qq.com', '.vn'];
            $banned_content = ['email marketing'];
</pre>
<p><strong>Please Note:</strong> make sure you use strings that are related to the spam you are actually getting. I am getting spam from .ru, qq.com and .vn domains, so that&#8217;s what I am blocking. I also get a lot of emails containing &#8220;email marketing&#8221; in the text, and am unlikely to get anything real with that type of content.<br />
Make sure you do not ban real customers!</p>
<p>We want to loop through both and spawn an error if anything is contained in the submitted variables:</p>
<pre class="brush: php; title: ; notranslate">
            foreach ($banned_in_email as $string) {
                if(strstr($from, $string))
                    $this-&gt;errors[] = Tools::displayError('This email address is not allowed');
            }
            foreach ($banned_content as $string) {
                if(strstr($message, $string))
                    $this-&gt;errors[] = Tools::displayError('Invalid content');
            }
</pre>
<p>And that&#8217;s basically it, we just need to call the parent at the very end of the method:</p>
<p>parent::postProcess();</p>
<p>And we are done! Here is the complete override:</p>
<pre class="brush: php; title: ; notranslate">
class ContactController extends ContactControllerCore
{
    public function postProcess()
    {
        if(Tools::isSubmit('submitMessage')) {

            $message = Tools::getValue('message');
            $from = Tools::getValue('from');

            $banned_in_email = ['.ru', 'qq.com', '.vn'];
            $banned_content = ['email marketing'];

            foreach ($banned_in_email as $string) {
                if(strstr($from, $string))
                    $this-&gt;errors[] = Tools::displayError('This email address is not allowed');
            }

            foreach ($banned_content as $string) {
                if(strstr($message, $string))
                    $this-&gt;errors[] = Tools::displayError('Invalid Content');
            }
        }
        parent::postProcess();
    }
}
</pre>
<p>Before you test, make sure you erase cache/class_index.php, so that the new override is loaded in the system.</p>
<p>The post <a rel="nofollow" href="http://nemops.com/blocking-spam-emails-in-prestashop/">Blocking spam emails in PrestaShop</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/blocking-spam-emails-in-prestashop/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Private Orders Shop in PrestaShop and thirty bees part 2: hide shopping options for visitors</title>
		<link>http://nemops.com/private-orders-in-prestashop-thirty-bees-2-hide-shopping-options-for-visitors/</link>
		<comments>http://nemops.com/private-orders-in-prestashop-thirty-bees-2-hide-shopping-options-for-visitors/#comments</comments>
		<pubDate>Mon, 18 Jun 2018 10:54:39 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[private]]></category>
		<category><![CDATA[shop]]></category>
		<category><![CDATA[thirtybees]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=3138</guid>
		<description><![CDATA[<p>In this second tutorial we will see how to prevent orders from non-registered customers, which is also necessary in case you applied the previous tutorial and are currently using a one page checkout. Watch the screencast Text Version METHOD 1 – Selectively enabling catalog mode If we don’t need to display prices to our visitors, [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://nemops.com/private-orders-in-prestashop-thirty-bees-2-hide-shopping-options-for-visitors/">Private Orders Shop in PrestaShop and thirty bees part 2: hide shopping options for visitors</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In this second tutorial we will see how to prevent orders from non-registered customers, which is also necessary in case you applied the previous tutorial and are currently using a one page checkout.<br />
<span id="more-3138"></span></p>
<h2>Watch the screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/TQQuckN9HdQ" 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>
<h3>METHOD 1 – Selectively enabling catalog mode</h3>
<p>If we don’t need to display prices to our visitors, the simplest and quickest way to proceed is by selectively enable catalog mode. Open classes/controller/FrontController.php, and locate the following string, inside the init method:</p>
<pre class="brush: php; title: ; notranslate">
'PS_CATALOG_MODE' =&gt; (bool)Configuration::get('PS_CATALOG_MODE') || (Group::isFeatureActive() &amp;amp;&amp;amp; !(bool)Group::getCurrent()-&gt;show_prices),
</pre>
<p>Replace it with the following:</p>
<pre class="brush: php; title: ; notranslate">
'PS_CATALOG_MODE' =&gt; $catalog_mode || (Group::isFeatureActive() &amp;amp;&amp;amp; !(bool)Group::getCurrent()-&gt;show_prices),
</pre>
<p>We need to create that $catalog_mode variable of course, so let’s add this before the whole assign block:</p>
<pre class="brush: php; title: ; notranslate">
$catalog_mode = (bool)Configuration::get('PS_CATALOG_MODE');
if(!$this-&gt;context-&gt;customer-&gt;id)
    $catalog_mode = true;
</pre>
<p>As you can see, we simply check if the customer id is set (that is, if the user is logged in) and if so, we set catalog mode to true, effectively disabling all cart functionalities. This however left us with a useless cart block, and without prices. Let’s see how to handle it differently then!</p>
<div class="separator"></div>
<h3>METHOD 2 – Selectively disable products</h3>
<p>I will create an override for this one, so in override/classes, let’s create a new file named Product.php.</p>
<p>Let&#8217;s open it up, and copy over the construct method from the core product class. Get rid of everything inside it, and simply add the following:</p>
<pre class="brush: php; title: ; notranslate">
Class Product extends ProductCore
{
    public function __construct($id_product = null, $full = false, $id_lang = null, $id_shop = null, Context $context = null)
    {
        parent::__construct($id_product, $id_lang, $id_shop);

        if(!Context::getContext()-&gt;customer-&gt;id)
            $this-&gt;available_for_order = false;
    }
}
</pre>
<p>This will take care of the product page. Now for the product list, the property is set elsewhere, and specifically in the getProductProperties method (without s). Copy the whole method from the original class again, but this time leave the content, and just append the following code at the end, right before self::$producPropertiesCache[$cache_key] = $row;</p>
<pre class="brush: php; title: ; notranslate">
if(!$context-&gt;customer-&gt;id)
    $row['available_for_order'] = false;
</pre>
<p>And that’s all we need! Since we created a new override, remember it’s necessary to erase cache/class_index.php in order for the changes to take place.</p>
<p>The post <a rel="nofollow" href="http://nemops.com/private-orders-in-prestashop-thirty-bees-2-hide-shopping-options-for-visitors/">Private Orders Shop in PrestaShop and thirty bees part 2: hide shopping options for visitors</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/private-orders-in-prestashop-thirty-bees-2-hide-shopping-options-for-visitors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Private Orders Shop in PrestaShop and thirty bees part 1: manual customer verification</title>
		<link>http://nemops.com/private-orders-shop-in-prestashop-and-thirty-bees-part-1-manual-customer-verification/</link>
		<comments>http://nemops.com/private-orders-shop-in-prestashop-and-thirty-bees-part-1-manual-customer-verification/#comments</comments>
		<pubDate>Wed, 30 May 2018 12:39:37 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[customers]]></category>
		<category><![CDATA[orders]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[private]]></category>
		<category><![CDATA[thirtybees]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=3133</guid>
		<description><![CDATA[<p>In this 2-part tutorial series, we will see how to create a private orders shop in PrestaShop and thirty bees. In this first part we will see how to add a manual approval for new customers while in the second on we will learn how to prevent orders from people who are not registered and [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://nemops.com/private-orders-shop-in-prestashop-and-thirty-bees-part-1-manual-customer-verification/">Private Orders Shop in PrestaShop and thirty bees part 1: manual customer verification</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In this 2-part tutorial series, we will see how to create a private orders shop in PrestaShop and thirty bees.<br />
In this first part we will see how to add a manual approval for new customers while in the second on  we will learn how to prevent orders from people who are not registered and approved by us.<br />
<span id="more-3133"></span></p>
<h2>Watch the screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/CkNh1VEdpbw" 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>I will use PrestaShop 1.6 for the demo but the modification works in thirty bees as well. Bear in mind it DOES NOT work in PrestaShop 1.7.</p>
<p>Open up controllers/front/AuthController.php</p>
<p>Look for the following code, around line 455. If it’s not in those whereabouts, just make sure you change every instance</p>
<pre class="brush: php; title: ; notranslate">
$customer-&gt;active = 1;
</pre>
<p>set to 0, so that the user cannot perform any action right away.</p>
<p>Now we also want to give the user some feedback, so let&#8217;s redirect him to a custom page. Scroll down a few lines, and where you see all these redirects:</p>
<pre class="brush: php; title: ; notranslate">
if (($back = Tools::getValue('back')) &amp;&amp; $back == Tools::secureReferrer($back)) {
                            Tools::redirect(html_entity_decode($back));
                        }
</pre>
<p>And add a new one before</p>
<pre class="brush: php; title: ; notranslate">
  Tools::redirect($this-&gt;context-&gt;link-&gt;getPageLink('welcome'));
</pre>
<p>Of course this page does not exist yet but we will create it in a moment.</p>
<p>Before that though, we have to take care of a little issue. Since the user has been created but set to inactive, the system treats it as banned by default. Even if we are to redirect to a page, we would instantly be kicked out of the session and redirected to the login. We want to create an exception so that the welcome page can be displayed. </p>
<p>Let&#8217;s go ahead and open up the customer class, so classes/customer.php<br />
Look for the following method:</p>
<pre class="brush: php; title: ; notranslate">
public static function isBanned($id_customer)
</pre>
<p>And at the very beginning, add:</p>
<pre class="brush: php; title: ; notranslate">
        if(Context::getContext()-&gt;controller-&gt;php_self == 'welcome')
            return false;
</pre>
<p>That’s settled! Now for our welcome page, I will create a new controller and a template file in the theme folder</p>
<p>Let’s head to controllers/front, and create a new PHP file first, named WelcomeController.php:</p>
<pre class="brush: php; title: ; notranslate">
class WelcomeControllerCore extends FrontController
{
    public $php_self = 'welcome';


    public function initContent()
    {
        parent::initContent();
        $this-&gt;setTemplate(_PS_THEME_DIR_.'welcome.tpl');
    }
}
</pre>
<p>Then in the theme folder, create a new file named welcome.tpl, adding the following code inside</p>
<pre class="brush: php; html-script: true; title: ; notranslate">
{capture name=&quot;path&quot;} {l s='Welcome'}{/capture}
&lt;h1&gt;{l s='Welcome to'} {$shop_name}! &lt;/h1&gt;
&lt;hr&gt;
&lt;p&gt;
	{l s='Your account is currently under review, you will receive an email as soon as it is validated'}
&lt;/p&gt;
</pre>
<p>So let&#8217;s go ahead and try it out now&#8230; but before let&#8217;s clear cache by erasing cache/class_index.php, since we added a new controller and the system wouldn’t read it otherwise.</p>
<p>The next step is to send out and email when a status is changed to active for the customer, in the back office.<br />
Open controllers/admin/admincustomerscontroller.php</p>
<p>We will add a new method, which is inherited from the admincontroller class:</p>
<pre class="brush: php; title: ; notranslate">

    public function processStatus()
    {
        if($object = parent::processStatus()) {
            if(get_class($object) == 'Customer' &amp;&amp; $object-&gt;active) // the customer has been activated, send out an email
            {
                Mail::Send($object-&gt;id_lang, 'account_activated', $this-&gt;l('Your account has been activated'),
                    ['name' =&gt; $object-&gt;firstname .' '. $object-&gt;lastname],
                $object-&gt;email,
                $object-&gt;firstname .' '. $object-&gt;lastname,
                Configuration::get('PS_SHOP_EMAIL'),
                Configuration::get('PS_SHOP_NAME'));
            }
        }

       return $object;
    }

</pre>
<p>Of course, there is no such email template so we have to create it. I suggest copying an existing one, like the order confirmation, and adding new text, just to be quicker. The code is different for every template, just bear in mind to add the {name} variable inside it, so that the customer name is displayed!</p>
<p>This is it for part 1, make sure you test the email as well since sometimes they do fail for odd reasons, if you don&#8217;t see it coming, triple check the template names and make sure they are located in the proper path for each language you use.</p>
<p>In part two we will see how to prevent orders in case a customer is not registered, which is fundamental not to break the system if you have a one page checkout, as right now it would display an error.</p>
<p>The post <a rel="nofollow" href="http://nemops.com/private-orders-shop-in-prestashop-and-thirty-bees-part-1-manual-customer-verification/">Private Orders Shop in PrestaShop and thirty bees part 1: manual customer verification</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/private-orders-shop-in-prestashop-and-thirty-bees-part-1-manual-customer-verification/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create a &#8220;Go back to the category&#8221; button in PrestaShop and thirty bees</title>
		<link>http://nemops.com/how-to-create-a-go-back-to-the-category-button-in-prestashop-and-thirty-bees/</link>
		<comments>http://nemops.com/how-to-create-a-go-back-to-the-category-button-in-prestashop-and-thirty-bees/#comments</comments>
		<pubDate>Mon, 09 Apr 2018 10:56:55 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[prestashop 1.6]]></category>
		<category><![CDATA[thirtybees]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=3125</guid>
		<description><![CDATA[<p>In this video we will make a handy button to let our customers navigate back to the previously visited category from the product page, in PrestaShop 1.6 and thirty bees Watch the screencast Text Version To start with, open up global.js, located in your theme folder /js. At the very end, add the following: Then, [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://nemops.com/how-to-create-a-go-back-to-the-category-button-in-prestashop-and-thirty-bees/">How to create a &#8220;Go back to the category&#8221; button in PrestaShop and thirty bees</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In this video we will make a handy button to let our customers navigate back to the previously visited category from the product page, in PrestaShop 1.6 and thirty bees<br />
<span id="more-3125"></span></p>
<h2>Watch the screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/nOR7f_76LHE" 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>To start with, open up <strong>global.js</strong>, located in your theme folder <em>/js</em>. At the very end, add the following:</p>
<pre class="brush: jscript; title: ; notranslate">

$(document).ready(function() {
	if($('body').hasClass('category'))
	{
		$('.product_img_link').click(function(e) {
			$.totalStorage('last_visited_category', window.location.href);
		});
	}
});
</pre>
<p>Then, in <strong>product.tpl</strong>, again in the theme folder, find a proper spot for the button, then add the following inside a &lt;script&gt; tag:</p>
<pre class="brush: jscript; title: ; notranslate">
	$(document).ready(function() {
		if(previous_category = $.totalStorage('last_visited_category'))
		{
			$('#goback').attr('href', previous_category);
			$.totalStorage('last_visited_category', '');
		} else $('#goback').hide();
	});
</pre>
<p>Right after id, add our button:</p>
<pre class="brush: xml; title: ; notranslate">

&lt;a href=&quot;javascript:void(0)&quot; class=&quot;btn btn-default&quot; id=&quot;goback&quot;&gt;
	&lt;i class=&quot;icon-chevron-left left&quot;&gt;&lt;/i&gt; {l s='Go Back to the last category'}
&lt;/a&gt;
</pre>
<p>Here is the final code for product.tpl</p>
<pre class="brush: xml; title: ; notranslate">
&lt;script&gt;

	$(document).ready(function() {
		if(previous_category = $.totalStorage('last_visited_category'))
		{
			$('#goback').attr('href', previous_category);
			$.totalStorage('last_visited_category', '');
		} else $('#goback').hide();
	});
&lt;/script&gt;

&lt;a href=&quot;javascript:void(0)&quot; class=&quot;btn btn-default&quot; id=&quot;goback&quot;&gt;
	&lt;i class=&quot;icon-chevron-left left&quot;&gt;{l s='Go Back to the last category'}&lt;/i&gt;
&lt;/a&gt;

</pre>
<p><strong>Notice:</strong> If you want to keep a record of the visited category across pages, you can remove <strong>$.totalStorage(&#8216;last_visited_category&#8217;, &#8221;);</strong> from the code in product.tpl.</p>
<p>The post <a rel="nofollow" href="http://nemops.com/how-to-create-a-go-back-to-the-category-button-in-prestashop-and-thirty-bees/">How to create a &#8220;Go back to the category&#8221; button in PrestaShop and thirty bees</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/how-to-create-a-go-back-to-the-category-button-in-prestashop-and-thirty-bees/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Litespeed module for PrestaShop and thirty bees</title>
		<link>http://nemops.com/litespeed-module-prestashop-thirty-bees/</link>
		<comments>http://nemops.com/litespeed-module-prestashop-thirty-bees/#comments</comments>
		<pubDate>Sun, 11 Feb 2018 23:16:01 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[litespeed]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[thirtybees]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=3119</guid>
		<description><![CDATA[<p>If you are running PrestaShop or thirty bees on a litespeed server, this module helps you take full advantage of it Watch the screencast</p>
<p>The post <a rel="nofollow" href="http://nemops.com/litespeed-module-prestashop-thirty-bees/">Litespeed module for PrestaShop and thirty bees</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>If you are running PrestaShop or thirty bees on a litespeed server, this module helps you take full advantage of it<br />
<span id="more-3119"></span></p>
<h2>Watch the screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/GNg8D5m7Xy4" 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/litespeed-module-prestashop-thirty-bees/">Litespeed module for PrestaShop and thirty bees</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/litespeed-module-prestashop-thirty-bees/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting up a staging site for PrestaShop and Thirtybees</title>
		<link>http://nemops.com/staging-site-prestashop-thirtybees/</link>
		<comments>http://nemops.com/staging-site-prestashop-thirtybees/#comments</comments>
		<pubDate>Wed, 10 Jan 2018 08:18:49 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[staging]]></category>
		<category><![CDATA[thirtybees]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=3116</guid>
		<description><![CDATA[<p>It’s always better not to directly modify your live site, especially when core changes are involved. In this video, we will see how to create a development site for PrestaShop 1.6 and ThirtyBees Watch the screencast</p>
<p>The post <a rel="nofollow" href="http://nemops.com/staging-site-prestashop-thirtybees/">Setting up a staging site for PrestaShop and Thirtybees</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>It’s always better not to directly modify your live site, especially when core changes are involved. In this video, we will see how to create a development site for PrestaShop 1.6 and ThirtyBees<br />
<span id="more-3116"></span></p>
<h2>Watch the screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/ATV5K9UpJHs" 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/staging-site-prestashop-thirtybees/">Setting up a staging site for PrestaShop and Thirtybees</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/staging-site-prestashop-thirtybees/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New module: &#8220;Address Fields&#8221; just released!</title>
		<link>http://nemops.com/new-module-prestashop-address-fields-released/</link>
		<comments>http://nemops.com/new-module-prestashop-address-fields-released/#comments</comments>
		<pubDate>Mon, 27 Nov 2017 11:09:09 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[address]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[thirtybees]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=3104</guid>
		<description><![CDATA[<p>If you need to add new fields to the customer addresses in PrestaShop or ThirtyBees, this module will make your life a lot easier, with its automated process! Get it here Watch the video guide Core features Unlimited fields: Add as many new fields as you like Multiple input types: Choose between text, textarea or [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://nemops.com/new-module-prestashop-address-fields-released/">New module: &#8220;Address Fields&#8221; just released!</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>If you need to add new fields to the customer addresses in PrestaShop or ThirtyBees, this module will make your life a lot easier, with its automated process!<br />
<span id="more-3104"></span><br />
<a style="text-align:center" class="button style1" title="Get the PrestaShop Address Fields Module here" href="http://store.nemops.com/modules/45-prestashop-address-fields.html#.WhvvvEqWaUk">Get it here</a></p>
<h2>Watch the video guide</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/epnxI42c9ek" 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>
<h3>Core features</h3>
<ul>
<li><strong>Unlimited fields</strong>: Add as many new fields as you like</li>
<li>Multiple input types: <strong>Choose between text, textarea or select box</strong> to perfectly fit the type of data you require from your customers</li>
<li>Customizable format</li>
<li>Choose if you want to display the fields in the back office list as well</li>
<li>Multilanguage labels</li>
</ul>
<p>The post <a rel="nofollow" href="http://nemops.com/new-module-prestashop-address-fields-released/">New module: &#8220;Address Fields&#8221; just released!</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/new-module-prestashop-address-fields-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<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>
	</channel>
</rss>
