[-] Module: Mailalert should not send email to employee if stock management is disabled #PSCFV-5841

This commit is contained in:
Rémi Gaillard
2012-11-29 16:28:18 +01:00
parent 3b63713cdd
commit 0e4bf800c6
+2 -2
View File
@@ -258,7 +258,7 @@ class MailAlerts extends Module
public function hookActionValidateOrder($params)
{
if (!$this->_merchant_order || empty($this->_merchant_mails))
if (!$this->_merchant_order || empty($this->_merchant_mails) || !Configuration::get('PS_STOCK_MANAGEMENT'))
return;
// Getting differents vars
@@ -431,7 +431,7 @@ class MailAlerts extends Module
$product = new Product($id_product, true, $id_lang, $id_shop, Context::getContext());
$ma_last_qties = (int)Configuration::get('MA_LAST_QTIES');
if ($product->active == 1 && (int)$quantity <= $ma_last_qties && !(!$this->_merchant_oos || empty($this->_merchant_mails)))
if ($product->active == 1 && (int)$quantity <= $ma_last_qties && !(!$this->_merchant_oos || empty($this->_merchant_mails)) && Configuration::get('PS_STOCK_MANAGEMENT'))
{
$iso = Language::getIsoById($id_lang);
$product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang);