// Context part 13
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7650 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -318,20 +318,17 @@ class MailAlerts extends Module
|
||||
$this->sendCustomerAlert((int)$result['id_product'], (int)$params['id_product_attribute']);
|
||||
}
|
||||
|
||||
public function sendCustomerAlert($id_product, $id_product_attribute, $context = null)
|
||||
public function sendCustomerAlert($id_product, $id_product_attribute)
|
||||
{
|
||||
if (!$context)
|
||||
$context = Context::getContext();
|
||||
|
||||
$customers = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
|
||||
SELECT id_customer, customer_email
|
||||
FROM `'._DB_PREFIX_.'mailalert_customer_oos`
|
||||
WHERE `id_product` = '.(int)$id_product.' AND `id_product_attribute` = '.(int)$id_product_attribute);
|
||||
|
||||
$product = new Product((int)$id_product, false, (int)$context->language->id);
|
||||
$product = new Product((int)$id_product, false, $this->context->language->id);
|
||||
$templateVars = array(
|
||||
'{product}' => (is_array($product->name) ? $product->name[(int)Configuration::get('PS_LANG_DEFAULT')] : $product->name),
|
||||
'{product_link}' => $context->link->getProductLink($product)
|
||||
'{product_link}' => $this->context->link->getProductLink($product)
|
||||
);
|
||||
foreach ($customers AS $cust)
|
||||
{
|
||||
@@ -346,7 +343,7 @@ class MailAlerts extends Module
|
||||
$customer_email = $cust['customer_email'];
|
||||
$customer_id = 0;
|
||||
}
|
||||
$iso = $context->language->iso_code;
|
||||
$iso = $this->context->language->iso_code;
|
||||
|
||||
if (file_exists(dirname(__FILE__).'/mails/'.$iso.'/customer_qty.txt') AND file_exists(dirname(__FILE__).'/mails/'.$iso.'/customer_qty.html'))
|
||||
Mail::Send((int)(Configuration::get('PS_LANG_DEFAULT')), 'customer_qty', Mail::l('Product available'), $templateVars, strval($customer_email), NULL, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/');
|
||||
|
||||
Reference in New Issue
Block a user