Jump to content

[resolved]changing mailalertsv2.2


hulk

Recommended Posts

hello
in my shop I list my combinations form for the product and when I activate the module mailalerts v2.2 takes into consideration the quantity of stock of each combinations but this is not what i need.I want the module s 'displays only the total amount of stock of the product that is to say that emails will be sent when the total stock of product = 0 and not when the stock of the combination is zero.
I am not a coder that is why I'm posting this topic by asking your help.
thank you

Link to comment
Share on other sites

I noticed this feature in the file mailalerts.php L213 and I think it's the function to send mail when the stock of a combinations = 0

public function hookUpdateQuantity($params)
   {
       $qty = intval($params['product']['quantity_attribute'] ? $params['product']['quantity_attribute'] : $params['product']['stock_quantity']) - intval($params['product']['quantity']);
       if ($qty <= intval(Configuration::get('PS_LAST_QTIES')) AND !(!$this->_merchant_oos OR empty($this->_merchant_mails)) AND Configuration::get('PS_STOCK_MANAGEMENT'))
       {
           $templateVars = array('{qty}' => $qty,
           '{last_qty}' => intval(Configuration::get('PS_LAST_QTIES')),
           '{product}' => strval($params['product']['name']),
           '{pref}' => intval($params['product']['id_product'])
           );
           Mail::Send(intval(Configuration::get('PS_LANG_DEFAULT')), 'productoutofstock', $this->l('Product out of stock'), $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/');
       }
   }


but how can I change it to send email just when the total stock = 0
plz help
thx

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...