1. Home
  2. Articles
  3. General
  4. Stop sending alerts with module “Mail alerts”

Stop sending alerts with module “Mail alerts”

The built-in module Mail alerts offers a great feature to notify shop owners whenever a new order placed on their web shop.

But it does not seem to be helpful with orders made via RockPOS at their POS terminals. So, how to stop sending this notification, just case of RockPOS orders? There is no obvious way, unfortunately.

In this article, we demonstrate how to achieve that on your own without PHP or Prestashop knowledge in 3 steps.

Here are the steps:

Step 1: Determine your PrestaShop version

If it’s 1.6.0.11 or upper, go to step 2a.

Otherwise, move on step 2b.

Step 2: Do the trick

2a: 

– Log into your FTP or cPanel

– Locate to webroot / overrides / modules / 

– Create a sub-directory called ” mailalerts“, so we have webroot / overrides / modules / mailalerts /

– Under this newly created directory, create a file mailalert.php, copy and paste this code snippet below, then save the file:

<?php

class MailAlertsOverride extends MailAlerts
{
    /**
     * Override: don't send notification on new order of RockPOS
     * @see Mailalerts::hookActionValidateOrder()
     */
    public function hookActionValidateOrder($params)
    {
        if ($params['order']->module == 'hspointofsalepro') {
            return;
        }
        return parent::hookActionValidateOrder($params);
    }
}

– Delete file webroot / cache / class_index.php

2b: 

– Log into your FTP or cPanel

– Locate to webroot / modules / mailalerts / mailalerts.php

– Look up for this line of code

public function hookActionValidateOrder($params)

– Add this code snippet into the beginning of that function:

if ($params['order']->module == 'hspointofsalepro') {
	return;
}

– It should look like this:


Step 3: Enjoy

Was this article helpful to you? Yes No

How can we help?