Search the Community
Showing results for tags 'stock notification'.
-
Hello. Mail alert module v.2.20, send mail "out of stock" every order placed, and totally ignoring the minimum quantity stock configured for alert. Example: Ipod: 10 pc. new order: -1 pc. total stock: 9 pc. Minimum quantity for sending alert: 3 pc. Mail sent (when it shouldn't). How can be fixed ? I think the code interested is in /modules/mailalerts/mailalerts.php public function hookUpdateQuantity($params) { global $cookie; if (is_object($params['product'])) $params['product'] = get_object_vars($params['product']); if (is_array($params['product']['name'])) $params['product']['name'] = $params['product']['name'][(int)Configuration::get('PS_LANG_DEFAULT')]; if (isset($params['product']['id_product'])) $params['product']['id'] = (int)$params['product']['id_product']; $qty = (int)$params['product']['quantity']; if ($qty <= (int)(Configuration::get('MA_LAST_QTIES')) AND !(!$this->_merchant_oos OR empty($this->_merchant_mails)) AND Configuration::get('PS_STOCK_MANAGEMENT')) { $templateVars = array( '{qty}' => $qty, '{last_qty}' => (int)(Configuration::get('MA_LAST_QTIES')), '{product}' => strval($params['product']['name']).(isset($params['product']['attributes_small']) ? ' '.$params['product']['attributes_small'] : '')); $id_lang = (is_object($cookie) AND isset($cookie->id_lang)) ? (int)$cookie->id_lang : (int)Configuration::get('PS_LANG_DEFAULT'); $iso = Language::getIsoById((int)$id_lang); if ($params['product']['active'] == 1){ if (file_exists(dirname(__FILE__).'/mails/'.$iso.'/productoutofstock.txt') AND file_exists(dirname(__FILE__).'/mails/'.$iso.'/productoutofstock.html')) Mail::Send((int)Configuration::get('PS_LANG_DEFAULT'), 'productoutofstock', Mail::l('Product out of stock', (int)Configuration::get('PS_LANG_DEFAULT')), $templateVars, explode(self::__MA_MAIL_DELIMITOR__, $this->_merchant_mails), NULL, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/'); } } if ($this->_customer_qty AND $params['product']['quantity'] > 0) $this->sendCustomerAlert((int)$params['product']['id'], 0); } How can be fixed ? PS: 1.4.7.3 Thank you.
- 1 reply
-
- mail alert
- stock management
-
(and 1 more)
Tagged with: