kg4geq Posted August 10, 2013 Share Posted August 10, 2013 (edited) I am running PS 1.5.4.1 and found an error. Hopefully someone here can help fix it. Good news is, I think I know what is causing the error...just not sure what code needs to be changed. On PS 1.5.4.1, running Mail Alerts module version 2.4. If the customer is NOT logged in, a product that is currently out of stock correctly displays a "Notify me when available" button with a field for the non-logged in user to enter their email. This appears to run from: /modules/mailalerts/mailalerts.php and creates a table called: prefix_mailalert_customer_oos For the first non-logged in user that enters their email for an out-of-stock product, it correctly creates a record in this table. The columns in the table are: id_customer, customer_email, id_product, id_product_attribute, id_shop. A non-logged in user is given the 'id_customer' of "0". The problem lies here. If another non-logged in user attempts to enter their email, mailalerts throws back the error "You already have an alert for this product". Apparently, mailalerts is referencing the 'id_customer' AND 'id_product'. If a non-logged in user which is given the 'id_customer' of "0" has stored their email for that 'id_product', mailalerts is NOT allowing it to store another user's email address in 'customer_email' for the same product. So, how can we get mailalerts to store multiple email addresses in 'customer_email' for non-logged in users in the 'id_customer'=0 and an 'id_product' has already been stored in the table? I used phpMyAdmin to browse this table to figure this out. It was also handy to finally see what customers and how many are storing email alerts for what products. I wish there was a place in the BO to see this rather than logging in to phpMyAdmin. However, we need to get this code changed so it will store multiple non-logged in users to register their emails for the same OOS product. Hopefully I was thorough enough to get some of the more advanced users on here the necessary data to offer some suggestions. Thanks, -Mark Edited August 11, 2013 by kg4geq (see edit history) Link to comment Share on other sites More sharing options...
kg4geq Posted August 12, 2013 Author Share Posted August 12, 2013 It actually looks like the change may need to occur in /modules/mailalerts/MailAlert.php Anyone have a suggestion on how to store email mail alerts for multiple unsigned in users who have the id_customer=0 and the same id_product? Link to comment Share on other sites More sharing options...
kg4geq Posted August 13, 2013 Author Share Posted August 13, 2013 Is there any sql ninja that can point in the right direction to allow this? Maybe some sort of "if" statement? Thanks, -Mark Link to comment Share on other sites More sharing options...
kg4geq Posted August 18, 2013 Author Share Posted August 18, 2013 *bump* Link to comment Share on other sites More sharing options...
JStormrage Posted August 21, 2013 Share Posted August 21, 2013 I'm having the same problem, You already have an alert for this product for guest users. Link to comment Share on other sites More sharing options...
Debra Martin Posted September 3, 2013 Share Posted September 3, 2013 I noticed this as well. Maybe creating a test to see if the customer is logged in and using an alert like "You must be logged in to use this feature" would help? I will look into it and if I figure something out before it is fixed, I'll post it here. Link to comment Share on other sites More sharing options...
Debra Martin Posted September 3, 2013 Share Posted September 3, 2013 ... also, requiring a customer to be logged in would eliminate the problem of sending [email protected] if the customer doesn't enter an email address. Link to comment Share on other sites More sharing options...
benjamin utterback Posted September 17, 2013 Share Posted September 17, 2013 Hello, thank you all for your posts. This problem is reported and we will be working on investigating and fixing any issues shortly. In the meantime please check the forge http://forge.prestashop.com/browse/PNM-1669 Link to comment Share on other sites More sharing options...
benjamin utterback Posted September 23, 2013 Share Posted September 23, 2013 ... also, requiring a customer to be logged in would eliminate the problem of sending [email protected] if the customer doesn't enter an email address. Hello, please use this module for v1.5.5 . It is updated and should solve the issue. mailalerts.zip Link to comment Share on other sites More sharing options...
indus Posted January 8, 2014 Share Posted January 8, 2014 (edited) Iam still having this problem. Using 1.5.6.1. If iam logged in, i cant see any option either to enter my email address to receive notifications. Its only visible for guest accounts. Edit : Uninstalling old module and installing new one solved the problem for me. Edited January 8, 2014 by indus (see edit history) Link to comment Share on other sites More sharing options...
tomikk Posted July 19, 2016 Share Posted July 19, 2016 Hello, please use this module for v1.5.5 . It is updated and should solve the issue. mailalerts.zip I don't know why, it shows me 404 when I want to download. Can you provide me link directly do download? Did that work for you with guest notification bug? Alle files should I replace or only couple of them? Thank you, Regards, Tom Link to comment Share on other sites More sharing options...
Recommended Posts