<?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; customers</title>
	<atom:link href="https://nemops.com/tag/customers/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>Private Orders Shop in PrestaShop and thirty bees part 1: manual customer verification</title>
		<link>https://nemops.com/private-orders-shop-in-prestashop-and-thirty-bees-part-1-manual-customer-verification/</link>
		<comments>https://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="https://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="https://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="https://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="https://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://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>Creating welcome coupons for your clients in PrestaShop</title>
		<link>https://nemops.com/prestashop-welcome-coupons/</link>
		<comments>https://nemops.com/prestashop-welcome-coupons/#comments</comments>
		<pubDate>Mon, 19 Sep 2016 10:46:49 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[cart rules]]></category>
		<category><![CDATA[customers]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[vouchers]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=2861</guid>
		<description><![CDATA[<p>In this quick tip we will create welcome coupons for our clients, to reward the ones who decide to sign up for an account on our shop. In order to create a discount code for clients who register new accounts on our store, we must edit the AuthController file. As always, the best practice is [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-welcome-coupons/">Creating welcome coupons for your clients 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 create welcome coupons for our clients, to reward the ones who decide to sign up for an account on our shop.</p>
<p><span id="more-2861"></span></p>
<p>In order to create a discount code for clients who register new accounts on our store, we must edit the <strong>AuthController</strong> file. As always, the best practice is to create an override for it, so let&#8217;s add a new one inside <em>override/controllers/front/</em>, named AuthController.php<br />
Open it up and add some generic override code inside php tags:</p>
<pre class="brush: php; title: ; notranslate">
Class AuthController extends AuthControllerCore
{

}
</pre>
<p>The method we are interested in is <strong>sendConfirmationMail</strong>. We can get it straight out of the original controller, and I suggest you take it from yours since it might differ from mine (I am using PrestaShop 1.6.1.6):</p>
<pre class="brush: php; title: ; notranslate">
    protected function sendConfirmationMail(Customer $customer)
    {
        if (!Configuration::get('PS_CUSTOMER_CREATION_EMAIL')) {
            return true;
        }

        return Mail::Send(
            $this-&gt;context-&gt;language-&gt;id,
            'account',
            Mail::l('Welcome!'),
            array(
                '{firstname}' =&gt; $customer-&gt;firstname,
                '{lastname}' =&gt; $customer-&gt;lastname,
                '{email}' =&gt; $customer-&gt;email,
                '{passwd}' =&gt; Tools::getValue('passwd'))
            $customer-&gt;email,
            $customer-&gt;firstname.' '.$customer-&gt;lastname
        );
    }
</pre>
<p>Copy and paste it inside our new override. At this point we can add our code to create the new cart rule, <strong>right before</strong> it returns the Mail::Send method:</p>
<pre class="brush: php; title: ; notranslate">
        $cartRuleObj = new CartRule();
        $cartRuleObj-&gt;date_from = date('Y-m-d H:i:s');
        $cartRuleObj-&gt;date_to = '2046-12-12 00:00:00';
        $cartRuleObj-&gt;name[Configuration::get('PS_LANG_DEFAULT')] = 'Welcome coupon';
        $cartRuleObj-&gt;quantity = 1;
        $code = Tools::passwdGen();
        while (CartRule::cartRuleExists($code)) { // let's make sure there is no duplicate
            $code = Tools::passwdGen();
        }
        $cartRuleObj-&gt;code = $code;
        $cartRuleObj-&gt;quantity_per_user = 1;
        $cartRuleObj-&gt;reduction_percent = 20;
        $cartRuleObj-&gt;reduction_amount = 0;
        $cartRuleObj-&gt;free_shipping = 0;
        $cartRuleObj-&gt;active = 1;
        $cartRuleObj-&gt;minimum_amount = 0;
        $cartRuleObj-&gt;id_customer = $customer-&gt;id;
        $cartRuleObj-&gt;add();

</pre>
<p>For this example, I am creating a coupon with discount code that will give 20% off the price, that is going to be valid for a virtually indefinite period of time, with a single usage and restricted to this customer.<br />
Make sure you add the following line:</p>
<pre class="brush: php; title: ; notranslate">

$cartRuleObj-&gt;id_customer = $customer-&gt;id;

</pre>
<p>As it is what binds the rule to the current customer instance. Also notice I am generating a random code, and checking if there is any identical one in the database already using a while loop. While there is, we try creating a new one.</p>
<p>At this point, as soon as the customer accesses his account page, he will see the code in the My coupons section. However, as good practice we should really inform him in the account creation email as well. Let&#8217;s therefore amend the Mail:Send call as follows, by passing $code to the list of variables:</p>
<pre class="brush: php; title: ; notranslate">
 return Mail::Send(
            $this-&gt;context-&gt;language-&gt;id,
            'account',
            Mail::l('Welcome!'),
            array(
                '{firstname}' =&gt; $customer-&gt;firstname,
                '{lastname}' =&gt; $customer-&gt;lastname,
                '{email}' =&gt; $customer-&gt;email,
                '{passwd}' =&gt; Tools::getValue('passwd')),
                '{coupon}' =&gt; $code,
            $customer-&gt;email,
            $customer-&gt;firstname.' '.$customer-&gt;lastname
        );
</pre>
<p>Great, we are done with php. What we need to do now is edit the corresponding account.html and account.txt emails to reflect the {coupon} variable.<br />
Here is the final php code:</p>
<pre class="brush: php; title: ; notranslate">
    protected function sendConfirmationMail(Customer $customer)
    {
        if (!Configuration::get('PS_CUSTOMER_CREATION_EMAIL')) {
            return true;
        }

        // nemo tut welcome coupon
        
        $cartRuleObj = new CartRule();
        $cartRuleObj-&gt;date_from = date('Y-m-d H:i:s');
        $cartRuleObj-&gt;date_to = '2046-12-12 00:00:00';
        $cartRuleObj-&gt;name[Configuration::get('PS_LANG_DEFAULT')] = 'Welcome coupon';
        $cartRuleObj-&gt;quantity = 1;
        $code = Tools::passwdGen();
        while (CartRule::cartRuleExists($code)) { // let's make sure there is no duplicate
            $code = Tools::passwdGen();
        }
        $cartRuleObj-&gt;code = $code;
        $cartRuleObj-&gt;quantity_per_user = 1;
        $cartRuleObj-&gt;reduction_percent = 20;
        $cartRuleObj-&gt;reduction_amount = 0;
        $cartRuleObj-&gt;free_shipping = 0;
        $cartRuleObj-&gt;active = 1;
        $cartRuleObj-&gt;minimum_amount = 0;
        $cartRuleObj-&gt;id_customer = $customer-&gt;id;
        $cartRuleObj-&gt;add();


        return Mail::Send(
            $this-&gt;context-&gt;language-&gt;id,
            'account',
            Mail::l('Welcome!'),
            array(
                '{firstname}' =&gt; $customer-&gt;firstname,
                '{lastname}' =&gt; $customer-&gt;lastname,
                '{email}' =&gt; $customer-&gt;email,
                '{passwd}' =&gt; Tools::getValue('passwd')),
                '{coupon}' =&gt; $code
            $customer-&gt;email,
            $customer-&gt;firstname.' '.$customer-&gt;lastname
        );
    }
</pre>
<div class="separator"></div>
<h2>Editing emails in PrestaShop</h2>
<p>We have two ways to edit emails in PrestaShop: one is through the back office translations interface, the other is manual. Either will be fine, but I personally usually prefer to modify the html code directly.</p>
<h3>Editing PrestaShop emails using the back-office interface</h3>
<p>If you choose the first way, you can simply log in to the back office, and reach <strong>Localization > Translations</strong>. Choose<br />
<strong>Email Templates translations</strong> from the first dropdown, then your template, and lastly the language, then hit modify.<br />
In the next screen, toggle the <strong>Core emails</strong> section, and look for one labeled <em>account</em>.</p>
<p><a href="http://nemops.com/wp-content/uploads/2016/09/prestashop_welcome_coupon_edit_email.png"><img src="http://nemops.com/wp-content/uploads/2016/09/prestashop_welcome_coupon_edit_email-680x306.png" alt="prestashop_welcome_coupon_edit_email" width="680" height="306" class="aligncenter size-large wp-image-2865" /></a></p>
<p>What we want to do is edit the HTML template first, so click on <strong>Edit HTML version</strong>, and find a good spot where to add the new variable:</p>
<p><a href="http://nemops.com/wp-content/uploads/2016/09/prestashop_welcome_coupon_email.png"><img src="http://nemops.com/wp-content/uploads/2016/09/prestashop_welcome_coupon_email-680x455.png" alt="prestashop_welcome_coupon_email" width="680" height="455" class="aligncenter size-large wp-image-2866" /></a></p>
<p>Save, then do the same with the text version.</p>
<h3>Editing PrestaShop emails&#8217; HTMl directly</h3>
<p>The second way is the one I prefer, as the built in editor can often be confusing, when not messy. Once more, we need to make sure we are editing the correct email templates, usually located in the current theme&#8217;s folder <em>/mails/</em> followed by the language ISO.<br />
The files we are interested in are <strong>account.html</strong> and <strong>account.txt</strong>. Here is the snippet I added to the html version&#8221;</p>
<pre class="brush: xml; title: ; notranslate">
&lt;tr&gt;
    &lt;td class=&quot;space_footer&quot; style=&quot;padding:0!important&quot;&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
    &lt;td class=&quot;box&quot; style=&quot;border:1px solid #D6D4D4;background-color:#f8f8f8;padding:7px 0&quot;&gt;
        &lt;table class=&quot;table&quot; style=&quot;width:100%&quot;&gt;
            &lt;tr&gt;
                &lt;td width=&quot;10&quot; style=&quot;padding:7px 0&quot;&gt;&amp;nbsp;&lt;/td&gt;
                &lt;td style=&quot;padding:7px 0&quot;&gt;
                    &lt;font size=&quot;2&quot; face=&quot;Open-sans, sans-serif&quot; color=&quot;#555454&quot;&gt;
                        &lt;p style=&quot;border-bottom:1px solid #D6D4D4;margin:3px 0 7px;text-transform:uppercase;font-weight:500;font-size:18px;padding-bottom:10px&quot;&gt;20% off welcome code: {coupon}&lt;/p&gt;
                        
                    &lt;/font&gt;
                &lt;/td&gt;
                &lt;td width=&quot;10&quot; style=&quot;padding:7px 0&quot;&gt;&amp;nbsp;&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;
    &lt;/td&gt;
&lt;/tr&gt;
</pre>
<p>Which is basically a copy/paste of the one above, with a modified text. Once again, edit the txt version to add the variable there too.</p>
<div class="separator"></div>
<p>At this point, make sure the modification is working by creating a new account and seeing if your customer gets the new email template, we are done!</p>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-welcome-coupons/">Creating welcome coupons for your clients in PrestaShop</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://nemops.com/prestashop-welcome-coupons/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Prestashop 101 Day 10 &#8211; Prestashop Customers</title>
		<link>https://nemops.com/prestashop-customers/</link>
		<comments>https://nemops.com/prestashop-customers/#comments</comments>
		<pubDate>Tue, 10 Mar 2015 09:40:20 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Basics]]></category>
		<category><![CDATA[customers]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[prestashop 101]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=1067</guid>
		<description><![CDATA[<p>Time to get in touch with your customers. In this lesson we will have a look at all features concerning Prestashop customers: their information, customer groups, and the customer service. Running time: 19 mins Watch the screencast &#8211; 1.6 version Watch the screencast &#8211; 1.5 version All series&#8217; lessons Prestashop 1.6 Prestashop 1.5 Additional Resources PrestaShop [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-customers/">Prestashop 101 Day 10 &#8211; Prestashop Customers</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Time to get in touch with your customers. In this lesson we will have a look at all features concerning Prestashop customers: their information, customer groups, and the customer service.<br />
<span id="more-1067"></span></p>
<p><strong>Running time: </strong>19 mins</p>
<h2>Watch the screencast &#8211; 1.6 version</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/cNHddXKS4xY" 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>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/bc2udzvXho0" 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>
<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><a href="http://nemops.com/prestashop-categories-and-products" title="Prestashop 101 Day 3 – Prestashop categories and products">Prestashop 101 Day 3 – Prestashop categories and products</a></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>Prestashop 101 Day 10 – Prestashop Customers</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><a href="http://nemops.com/prestashop-categories-and-products" title="Prestashop 101 Day 3 – Prestashop categories and products">Prestashop 101 Day 3 – Prestashop categories and products</a></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>Prestashop 101 Day 10 – Prestashop Customers</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>
<h3>Additional Resources</h3>
<ul>
<li><a title="PrestaShop Ticket System" href="http://store.nemops.com/front-office-features/27-prestashop-ticket-system.html#.VP7Ka_mjOr2">PrestaShop Ticket System</a></li>
</ul>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-customers/">Prestashop 101 Day 10 &#8211; Prestashop Customers</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://nemops.com/prestashop-customers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Prestashop Ticket System Updated!</title>
		<link>https://nemops.com/prestashop-ticket-system-updated/</link>
		<comments>https://nemops.com/prestashop-ticket-system-updated/#comments</comments>
		<pubDate>Mon, 02 Mar 2015 10:47:37 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[customers]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[ticket]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=2339</guid>
		<description><![CDATA[<p>The Prestashop Ticket System module has been upgraded! Customers can finally open tickets without being forced to register! As I received plenty of requests (quite a lot really), I worked on the ticket system and re-coded part of it, so that you can finally allow guest tickets. Exactly, no more need for people to register, [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-ticket-system-updated/">Prestashop Ticket System Updated!</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>The Prestashop Ticket System module has been upgraded! Customers can finally open tickets without being forced to register!<br />
<span id="more-2339"></span></p>
<p>As I received plenty of requests (quite a lot really), I worked on the ticket system and re-coded part of it, so that you can finally allow guest tickets. Exactly, no more need for people to register, anyone can open a new ticket that can be followed as any other customer ticket, with email updated, etc.</p>
<p><strong>It will be 20% off for a week so don&#8217;t miss the chance!</strong></p>
<p><a style="text-align:center;width: 300px;margin:0 auto" class="button style1" href="http://store.nemops.com/front-office-features/27-prestashop-ticket-system.html#.VPQ-IvmjOr2">See the module</a></p>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-ticket-system-updated/">Prestashop Ticket System Updated!</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://nemops.com/prestashop-ticket-system-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get email notifications for new customers registrations</title>
		<link>https://nemops.com/email-notifications-new-customers/</link>
		<comments>https://nemops.com/email-notifications-new-customers/#comments</comments>
		<pubDate>Mon, 05 Jan 2015 11:38:16 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[customers]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[registration]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=2264</guid>
		<description><![CDATA[<p>In this quick tip we will see how to enable email notifications for when a new client registers to our shop. The Plan Since we want to be informed when a new user registers, we need to add our code snippets right where the user itself is notified about it. For this reason, we will [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://nemops.com/email-notifications-new-customers/">Get email notifications for new customers registrations</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 enable email notifications for when a new client registers to our shop.</p>
<p><span id="more-2264"></span></p>
<h2>The Plan</h2>
<p>Since we want to be informed when a new user registers, we need to add our code snippets right where the user itself is notified about it. For this reason, we will be extending the <strong>sendConfirmationMail</strong> method of the AuthController.php file, and create a new email template as well.</p>
<div class="separator"></div>
<h2>The AuthController override</h2>
<p>As always it&#8217;s good practice to use overrides instead of modifying core files directly (to preserve changes after updates). Therefore, create a new file called <strong>AuthController.php</strong> inside <em>override/controllers/front</em>. Inside php tags, paste the following override code:</p>
<pre class="brush: php; title: ; notranslate">
Class AuthController extends AuthControllerCore
{

	
}
</pre>
<p>As mentioned above, we need to extend the default <strong>sendConfirmationMail</strong> method, so let&#8217;s grab it from the original controller and paste it inside our override (this is from Prestashop 1.6.0.9):</p>
<pre class="brush: php; title: ; notranslate">
Class AuthController extends AuthControllerCore
{
	protected function sendConfirmationMail(Customer $customer)
	{
		if (!Configuration::get('PS_CUSTOMER_CREATION_EMAIL'))
			return true;

		return Mail::Send(
			$this-&gt;context-&gt;language-&gt;id,
			'account',
			Mail::l('Welcome!'),
			array(
				'{firstname}' =&gt; $customer-&gt;firstname,
				'{lastname}' =&gt; $customer-&gt;lastname,
				'{email}' =&gt; $customer-&gt;email,
				'{passwd}' =&gt; Tools::getValue('passwd')),
			$customer-&gt;email,
			$customer-&gt;firstname.' '.$customer-&gt;lastname
		);
	}
	
}
</pre>
<p>Just in case, let&#8217;s make sure emails still work. Erase the <strong>class_index.php</strong> located in the <em>cache/</em> folder. Then, try registering a new user and make sure you get the confirmation email. If you do, it&#8217;s time to add another rule to inform the admin; right before the return, add:</p>
<pre class="brush: php; title: ; notranslate">
Mail::Send(
			Configuration::get('PS_LANG_DEFAULT'),
			'account_for_admin',
			Mail::l('New client!'),
			array(
				'{firstname}' =&gt; $customer-&gt;firstname,
				'{lastname}' =&gt; $customer-&gt;lastname,
				'{email}' =&gt; $customer-&gt;email
				),
			Configuration::get('PS_SHOP_EMAIL'),
			Configuration::get('PS_SHOP_NAME')
		);
</pre>
<p><strong>Explanation:</strong> we just copied the returned code and adapted it to our needs;  first, instead of using the customer language to grab the email template, we use the shop&#8217;s default one. This way we don&#8217;t need to create multiple/translated templates. Then, we pass in &#8216;account_for_admin&#8217; as email template name; it doesn&#8217;t exist yet so don&#8217;t try running a new registration or it won&#8217;t work. Then, to preserve the user&#8217;s credentials we get rid of the password. Lastly we set the &#8220;to&#8221; parameter to the shop&#8217;s email, and set the receiver to the shop&#8217;s name. That&#8217;s all there is to it. Let&#8217;s now create that template.</p>
<div class="separator"></div>
<h2>Creating a new email template</h2>
<p>Instead of proceeding from scratch, I generally copy an existing html template, to have them all uniform. Let&#8217;s use that user welcome as base. Reach <em>mails/en</em> (or whatever your default language&#8217;s ISO is, you can check it in the back office, localization, languages); <strong>Clone both account.html and account.txt, and then rename them to account_for_admin.html and account_for_admin.txt</strong>. Open up the .txt file, it will look something like:</p>
<pre class="brush: xml; title: ; notranslate">


[{shop_url}] 

Hi {firstname} {lastname},

Thank you for creating a customer account at {shop_name}. 

Here are your login details:

E-MAIL ADDRESS: {email}

PASSWORD: {passwd} 		 

Important Security Tips:

* Always keep your account details safe.

* Never disclose your login details to anyone.

* Change your password regularly.

* Should you suspect someone is using your account illegally, please
notify us immediately.

You can now place orders on our shop: {shop_name}
[{shop_url}] 

{shop_name} [{shop_url}] powered by
PrestaShop(tm) [http://www.prestashop.com/] 


</pre>
<p>Let&#8217;s modify it so to fit our needs:</p>
<pre class="brush: xml; title: ; notranslate">


[{shop_url}] 

Hi!

A new customer just signed up for an account at {shop_name}. 

Here are the details:

E-MAIL ADDRESS: {email}

NAME: {firstname} {lastname}

</pre>
<p>Then, apply the same modifications to the html file (please note I am only copying relevant parts of the template):</p>
<pre class="brush: xml; title: ; notranslate">

&lt;tr&gt;
	&lt;td align=&quot;center&quot; class=&quot;titleblock&quot; style=&quot;padding:7px 0&quot;&gt;
		&lt;font size=&quot;2&quot; face=&quot;Open-sans, sans-serif&quot; color=&quot;#555454&quot;&gt;
			&lt;span class=&quot;title&quot; style=&quot;font-weight:500;font-size:28px;text-transform:uppercase;line-height:33px&quot;&gt;Hi {firstname} {lastname},&lt;/span&gt;&lt;br/&gt;
			&lt;span class=&quot;subtitle&quot; style=&quot;font-weight:500;font-size:16px;text-transform:uppercase;line-height:25px&quot;&gt;Thank you for creating a customer account at {shop_name}.&lt;/span&gt;
		&lt;/font&gt;
	&lt;/td&gt;
&lt;/tr&gt;
</pre>
<p>To</p>
<pre class="brush: xml; title: ; notranslate">

&lt;tr&gt;
	&lt;td align=&quot;center&quot; class=&quot;titleblock&quot; style=&quot;padding:7px 0&quot;&gt;
		&lt;font size=&quot;2&quot; face=&quot;Open-sans, sans-serif&quot; color=&quot;#555454&quot;&gt;
			&lt;span class=&quot;title&quot; style=&quot;font-weight:500;font-size:28px;text-transform:uppercase;line-height:33px&quot;&gt;Hi!&lt;/span&gt;&lt;br/&gt;
			&lt;span class=&quot;subtitle&quot; style=&quot;font-weight:500;font-size:16px;text-transform:uppercase;line-height:25px&quot;&gt;A new customer just signed up for an account at {shop_name}.&lt;/span&gt;
		&lt;/font&gt;
	&lt;/td&gt;
&lt;/tr&gt;
</pre>
<p>Then</p>
<pre class="brush: xml; title: ; notranslate">

&lt;tr&gt;
	&lt;td class=&quot;box&quot; style=&quot;border:1px solid #D6D4D4;background-color:#f8f8f8;padding:7px 0&quot;&gt;
		&lt;table class=&quot;table&quot; style=&quot;width:100%&quot;&gt;
			&lt;tr&gt;
				&lt;td width=&quot;10&quot; style=&quot;padding:7px 0&quot;&gt;&amp;nbsp;&lt;/td&gt;
				&lt;td style=&quot;padding:7px 0&quot;&gt;
					&lt;font size=&quot;2&quot; face=&quot;Open-sans, sans-serif&quot; color=&quot;#555454&quot;&gt;
						&lt;p data-html-only=&quot;1&quot; style=&quot;border-bottom:1px solid #D6D4D4;margin:3px 0 7px;text-transform:uppercase;font-weight:500;font-size:18px;padding-bottom:10px&quot;&gt;
							Your {shop_name} login details						&lt;/p&gt;
						&lt;span style=&quot;color:#777&quot;&gt;
							Here are your login details:&lt;br /&gt; 
							&lt;span style=&quot;color:#333&quot;&gt;&lt;strong&gt;E-mail address: &lt;a href=&quot;mailto:{email}&quot; style=&quot;color:#337ff1&quot;&gt;{email}&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
							&lt;span style=&quot;color:#333&quot;&gt;&lt;strong&gt;Password:&lt;/strong&gt;&lt;/span&gt; {passwd}
						&lt;/span&gt;
					&lt;/font&gt;
				&lt;/td&gt;
				&lt;td width=&quot;10&quot; style=&quot;padding:7px 0&quot;&gt;&amp;nbsp;&lt;/td&gt;
			&lt;/tr&gt;
		&lt;/table&gt;
	&lt;/td&gt;
&lt;/tr&gt;
</pre>
<p>To</p>
<pre class="brush: xml; title: ; notranslate">

&lt;tr&gt;
	&lt;td class=&quot;box&quot; style=&quot;border:1px solid #D6D4D4;background-color:#f8f8f8;padding:7px 0&quot;&gt;
		&lt;table class=&quot;table&quot; style=&quot;width:100%&quot;&gt;
			&lt;tr&gt;
				&lt;td width=&quot;10&quot; style=&quot;padding:7px 0&quot;&gt;&amp;nbsp;&lt;/td&gt;
				&lt;td style=&quot;padding:7px 0&quot;&gt;
					&lt;font size=&quot;2&quot; face=&quot;Open-sans, sans-serif&quot; color=&quot;#555454&quot;&gt;
						&lt;p data-html-only=&quot;1&quot; style=&quot;border-bottom:1px solid #D6D4D4;margin:3px 0 7px;text-transform:uppercase;font-weight:500;font-size:18px;padding-bottom:10px&quot;&gt;
							Your {shop_name} login details						&lt;/p&gt;
						&lt;span style=&quot;color:#777&quot;&gt;
							Here are your login details:&lt;br /&gt; 
							&lt;span style=&quot;color:#333&quot;&gt;&lt;strong&gt;E-mail address: &lt;a href=&quot;mailto:{email}&quot; style=&quot;color:#337ff1&quot;&gt;{email}&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
							&lt;span style=&quot;color:#333&quot;&gt;&lt;strong&gt;Password:&lt;/strong&gt;&lt;/span&gt; {passwd}
						&lt;/span&gt;
					&lt;/font&gt;
				&lt;/td&gt;
				&lt;td width=&quot;10&quot; style=&quot;padding:7px 0&quot;&gt;&amp;nbsp;&lt;/td&gt;
			&lt;/tr&gt;
		&lt;/table&gt;
	&lt;/td&gt;
&lt;/tr&gt;
</pre>
<p>Lastly, you can get rid of this:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;tr&gt;
	&lt;td class=&quot;space_footer&quot; style=&quot;padding:0!important&quot;&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
	&lt;td class=&quot;box&quot; style=&quot;border:1px solid #D6D4D4;background-color:#f8f8f8;padding:7px 0&quot;&gt;
		&lt;table class=&quot;table&quot; style=&quot;width:100%&quot;&gt;
			&lt;tr&gt;
				&lt;td width=&quot;10&quot; style=&quot;padding:7px 0&quot;&gt;&amp;nbsp;&lt;/td&gt;
				&lt;td style=&quot;padding:7px 0&quot;&gt;
					&lt;font size=&quot;2&quot; face=&quot;Open-sans, sans-serif&quot; color=&quot;#555454&quot;&gt;
						&lt;p style=&quot;border-bottom:1px solid #D6D4D4;margin:3px 0 7px;text-transform:uppercase;font-weight:500;font-size:18px;padding-bottom:10px&quot;&gt;Important Security Tips:&lt;/p&gt;
						&lt;ol style=&quot;margin-bottom:0&quot;&gt;
							&lt;li&gt;Always keep your account details safe.&lt;/li&gt;
							&lt;li&gt;Never disclose your login details to anyone.&lt;/li&gt;
							&lt;li&gt;Change your password regularly.&lt;/li&gt;
							&lt;li&gt;Should you suspect someone is using your account illegally, please notify us immediately.&lt;/li&gt;
						&lt;/ol&gt;
					&lt;/font&gt;
				&lt;/td&gt;
				&lt;td width=&quot;10&quot; style=&quot;padding:7px 0&quot;&gt;&amp;nbsp;&lt;/td&gt;
			&lt;/tr&gt;
		&lt;/table&gt;
	&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
	&lt;td class=&quot;space_footer&quot; style=&quot;padding:0!important&quot;&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
	&lt;td class=&quot;linkbelow&quot; style=&quot;padding:7px 0&quot;&gt;
		&lt;font size=&quot;2&quot; face=&quot;Open-sans, sans-serif&quot; color=&quot;#555454&quot;&gt;
			&lt;span&gt;You can now place orders on our shop: &lt;a href=&quot;{shop_url}&quot; style=&quot;color:#337ff1&quot;&gt;{shop_name}&lt;/a&gt;&lt;/span&gt;
		&lt;/font&gt;
	&lt;/td&gt;
&lt;/tr&gt;

						&lt;tr&gt;
							&lt;td class=&quot;space_footer&quot; style=&quot;padding:0!important&quot;&gt;&amp;nbsp;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr&gt;
							&lt;td class=&quot;footer&quot; style=&quot;border-top:4px solid #333333;padding:7px 0&quot;&gt;
								&lt;span&gt;&lt;a href=&quot;{shop_url}&quot; style=&quot;color:#337ff1&quot;&gt;{shop_name}&lt;/a&gt; powered by &lt;a href=&quot;http://www.prestashop.com/&quot; style=&quot;color:#337ff1&quot;&gt;PrestaShop&amp;trade;&lt;/a&gt;&lt;/span&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
					&lt;/table&gt;
				&lt;/td&gt;
				&lt;td class=&quot;space&quot; style=&quot;width:20px;padding:7px 0&quot;&gt;&amp;nbsp;&lt;/td&gt;
			&lt;/tr&gt;

</pre>
<p>And it&#8217;s done! Time to test the outcome!</p>
<div class="separator"></div>
<h2>Troubleshooting</h2>
<p>When dealing with emails and Prestashop, there is a high chance of failure. Don&#8217;t be discouraged if if doesn&#8217;t work at the first attempt, and check the following:</p>
<ul>
<li>- Send out a test email from advanced parameters -> emails to your mail address</li>
<li>- Make sure it didn&#8217;t end up in the spam folder</li>
<li>- Double-check the new template name, it must be <strong>account_for_admin</strong> everywhere</li>
<li>- Make sure you added the template to the correct iso folder. If unsure, clone it to every of them</li>
</ul>
<p>If you still don&#8217;t receive the email, it&#8217;s worth trying to kill the Mail::Send method in case of failure, by using the following code instead:</p>
<pre class="brush: php; title: ; notranslate">
Mail::Send(
			Configuration::get('PS_LANG_DEFAULT'),
			'account_for_admin',
			Mail::l('New client!'),
			array(
				'{firstname}' =&gt; $customer-&gt;firstname,
				'{lastname}' =&gt; $customer-&gt;lastname,
				'{email}' =&gt; $customer-&gt;email
				),
			Configuration::get('PS_SHOP_EMAIL'),
			Configuration::get('PS_SHOP_NAME'),
			null,null,null,null,_PS_MAIL_DIR_,true
		);
</pre>
<p>The last parameter I passed in is telling the method to die in case of failure. If that happens, you should be given more info about what went wrong.</p>
<p>The post <a rel="nofollow" href="https://nemops.com/email-notifications-new-customers/">Get email notifications for new customers registrations</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://nemops.com/email-notifications-new-customers/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
