darren62 Posted March 30, 2010 Share Posted March 30, 2010 I am using V1.2.5 and have virtually got the site running apart from a couple of niggling problems, one that will annoy the hell out of customers if I can't fix it.The first one is the back in stock email sent to customers. Where can it be edited? I have the mail template editor installed but it doesn't seem to be included with the others.The other problem is one that I can't work out at all. I have been running test orders and emails etc. through the site and it works fine apart from one absolutely crazy problem. I tried the email notification to see if it worked when I put the product out of stock and back in stock but it just keeps sending them.I would have thought that it would send one then clear it from the list but I have had at least 6 emails whilst messing with the site saying the product is back in stock. Surely this cannot be right can it? Link to comment Share on other sites More sharing options...
darren62 Posted April 2, 2010 Author Share Posted April 2, 2010 I can't believe that nobody else has either tried this or not had this problem or doesn't know why it happens.Surely someone knows why because this will annoy visitors like crazy if they keep getting emails about a product they enquired about once and it will happen as everyone has to keep updating stock levels. Link to comment Share on other sites More sharing options...
rocky Posted April 3, 2010 Share Posted April 3, 2010 Customers are supposed to go to the "My alerts" section of their account to unsubscribe from out-of-stock notifications. There is no way to see which customers are subscribed in the Back Office and unsubscribe them yourself. The only way is to go to the ps_mailalert_customer_oos table in phpMyAdmin and delete them from there.You could try modifying the updateQuantity function in classes/Product.php and add code like the following: Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'mailalert_customer_oos` WHERE `id_product` = '.intval($product['id_product'])); Link to comment Share on other sites More sharing options...
darren62 Posted April 3, 2010 Author Share Posted April 3, 2010 Hi RockyI will ask someone to try that code for me to see if it works. Surely if you have an express checkout module on then customers can't unsubscribe anyway and this does seem to be something that will drive customers away instead of attracting them.Email notification is great but anyone writing software should realise that they only want notifying once not every time you update for years unless they cancel their account which none of us want them to do.I say cancel their account because I would expect them to do this rather than try to locate to cancel in their account. Ease of use is everything for customers as experience tells us. Link to comment Share on other sites More sharing options...
darren62 Posted April 7, 2010 Author Share Posted April 7, 2010 Tried to find it but I can't see this in that page.Any idea what line it is on? Link to comment Share on other sites More sharing options...
rocky Posted April 7, 2010 Share Posted April 7, 2010 The updateQuantity function is on line 1397 of classes/Product.php in Prestashop v1.2.5. Link to comment Share on other sites More sharing options...
darren62 Posted April 8, 2010 Author Share Posted April 8, 2010 Hi RockyI tried that but it didn't work. If I put it in some places it completely removed the product from admin.Does it have to go in a particular place or on its own surrounded by the {}. Link to comment Share on other sites More sharing options...
dreamworker Posted April 22, 2010 Share Posted April 22, 2010 darren, what version of prestashop you have?I have 1.2.5 and alerts are automatically deleted after email is sent. You can check the line 273 (function sendCustomerAlert) in mailalerts.php - you should see function for deleting the alert. Link to comment Share on other sites More sharing options...
darren62 Posted April 22, 2010 Author Share Posted April 22, 2010 Running the same version but it keeps sending them and hasn't stopped yet.I will check that line but I have never edited the mailalerts.php so don't know why it should be different. Link to comment Share on other sites More sharing options...
darren62 Posted April 22, 2010 Author Share Posted April 22, 2010 I checked that file but all I had around that line was this. $customer_email = $cust['customer_email']; $customer_id = 0; } Mail::Send(intval(Configuration::get('PS_LANG_DEFAULT')), 'customer_qty', $this->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/'); self::deleteAlert(intval($customer_id), strval($customer_email), intval($id_product), intval($id_product_attribute)); } } public function hookCustomerAccount($params) { global $smarty; return $this->display(__FILE__, 'my-account.tpl');Is that right because that means nothing to me. Link to comment Share on other sites More sharing options...
dreamworker Posted April 22, 2010 Share Posted April 22, 2010 this is my sendCustomerAlert function in mailalerts.php (notice the last line - deleting alerts), yours is probably corrupted public function sendCustomerAlert($id_product, $id_product_attribute) { $customers = Db::getInstance()->ExecuteS(' SELECT id_customer, customer_email FROM `'._DB_PREFIX_.'mailalert_customer_oos` WHERE `id_product` = '.intval($id_product). ($id_product_attribute ? ' AND `id_product_attribute` = '.intval($id_product_attribute) : '')); $product = new Product(intval($id_product)); $templateVars = array( '{product}' => strval($product->name[intval(Configuration::get('PS_LANG_DEFAULT'))]) ); foreach ($customers as $cust) { if ($cust['id_customer']) { $customer = new Customer(intval($cust['id_customer'])); $customer_email = $customer->email; $customer_id = $customer->id; } else { $customer_email = $cust['customer_email']; $customer_id = 0; } Mail::Send(intval(Configuration::get('PS_LANG_DEFAULT')), 'customer_qty', $this->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/'); self::deleteAlert(intval($customer_id), strval($customer_email), intval($id_product), intval($id_product_attribute)); } } Link to comment Share on other sites More sharing options...
Site Posted June 8, 2010 Share Posted June 8, 2010 I have this working perfect,Is there anyway of adding to the email which product they received the alert for? Dear Customer, The item you were watching is now once again in-stock.You can order it right now from our on-line shop. to change to Dear Customer, The product ******** is now once again in-stock. [LINK]You can order it right now from our on-line shop. Link to comment Share on other sites More sharing options...
Site Posted June 8, 2010 Share Posted June 8, 2010 Fixed it with {product} Link to comment Share on other sites More sharing options...
leelee23 Posted September 7, 2010 Share Posted September 7, 2010 Hi Site, just wondering, as on the change you wanted you were hoping to put a link to the product - just wondering how you achieved this? I tried but apparently the variable id_product didn't exist.. therefore the link didn't insert a number, just the variable. How did you get around this? Link to comment Share on other sites More sharing options...
Site Posted September 7, 2010 Share Posted September 7, 2010 Hi,Do you have HTML emails set to on ? Link to comment Share on other sites More sharing options...
leelee23 Posted September 7, 2010 Share Posted September 7, 2010 Yep - just for some reason the code I put above just isn't linking it correctly! Did you use a different variable? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now