smythsysgadjets Posted October 13, 2010 Share Posted October 13, 2010 Hi, Everytime a client does an order, I receive an email of "out of stock" even if the item still has stock. Order number is ok and the alert of out of stock is put to 3. How can that be? We have the latest prestashop version. 1.3.2.3 Thanks in advance Link to comment Share on other sites More sharing options...
jhnstcks Posted October 13, 2010 Share Posted October 13, 2010 You can set the mail alert threshold for out of stock emails in the mail alerts module configure screen. Its probabaly set at 5 which i think was the default seting. 1 Link to comment Share on other sites More sharing options...
smythsysgadjets Posted October 13, 2010 Author Share Posted October 13, 2010 It's set at three.... For example I had 10 items, the item was bought, the invoice said 9, everything ok, item bought... and we received an email at the same time saying out of stock, no items left. However the rest of the shop correctly says there are 9 left...STRANGE! Link to comment Share on other sites More sharing options...
lynx887 Posted October 13, 2010 Share Posted October 13, 2010 Same issue, also 1.3.2.3 Link to comment Share on other sites More sharing options...
smythsysgadjets Posted October 14, 2010 Author Share Posted October 14, 2010 For now I've disabled the email for the client on this state (out of stock) but it would be nice to have a solution to this. Prestashop works so nicely these issues are understandable but a nuisance. Link to comment Share on other sites More sharing options...
maestrobo Posted October 15, 2010 Share Posted October 15, 2010 same bug here with 1.3.2 Link to comment Share on other sites More sharing options...
maestrobo Posted October 15, 2010 Share Posted October 15, 2010 the place to debug the problem for those who are interested to have a lookis in modules/mailalerts/mailalerts.phpfunction public function hookUpdateQuantity($params)hope to understand what the problem is about.it seems the quantity value is set to zero while it is not everything is in this line $qty = intval(isset($params['product']['quantity_attribute']) AND $params['product']['quantity_attribute'] ? $params['product']['quantity_attribute'] : $params['product']['stock_quantity']); my guess to solve this problem is maybe to replace in these part of the code: $params['product']['stock_quantity'] with $params['product']['quantity'] another way is to try to update to latest SVN code. Link to comment Share on other sites More sharing options...
smythsysgadjets Posted October 15, 2010 Author Share Posted October 15, 2010 Hi maestrobo, THanks for the answer. For now I think I'll wait until a patch or newer version. The way prestashop updates I don´t to be changing code if it can be avoided. Then I'll never remember which files I've modified. This has to happen to others and I suppose a patch will be released.Thanks Link to comment Share on other sites More sharing options...
Alain Folletete Posted October 22, 2010 Share Posted October 22, 2010 Hi all,This bug has been fixed on SVN version (on 1.3.x branch) yesterday.This fix will be available soon on our next release.Thanks, Link to comment Share on other sites More sharing options...
lynx887 Posted October 22, 2010 Share Posted October 22, 2010 Good news, thanks :-) Link to comment Share on other sites More sharing options...
maestrobo Posted October 26, 2010 Share Posted October 26, 2010 have checked the SVN 1.3. version and didn't fix my problem.however, i found my own patch => please try it and see if it works for you:replace in modules/mailalerts/mailalerts.php $qty = intval(isset($params['product']['quantity_attribute']) AND $params['product']['quantity_attribute'] ? $params['product']['quantity_attribute'] : $params['product']['stock_quantity']); by $qty = intval((isset($params['product']['quantity_attribute']) AND is_int($params['product']['quantity_attribute'])) ? $params['product']['quantity_attribute'] : $params['product']['stock_quantity']); Link to comment Share on other sites More sharing options...
kingbbq Posted October 28, 2010 Share Posted October 28, 2010 Hi,before i've seen your post, i've done the same update and send my fix on french forum. This module works great now.It looks like a priority behaviour in PHP and our patch fix it well.well done maestrobo@+Emeric Link to comment Share on other sites More sharing options...
Pippo3000 Posted October 30, 2010 Share Posted October 30, 2010 Hi,before i've seen your post, i've done the same update and send my fix on french forum. This module works great now.It looks like a priority behaviour in PHP and our patch fix it well.well done maestrobo@+Emeric Thanks, both. Works just fine.Now there seems to be 1 thing left. When I re-stock the customer get the requested email but not with his name, only the html codes are shown {firstnam} {lastname}. Can I just remove these vars from the mail template? Link to comment Share on other sites More sharing options...
kingbbq Posted November 11, 2010 Share Posted November 11, 2010 Hi Pippo3000.Correct me if i'm wrong but since 1.3.* {firstname} and {lastname} aren't in the template mail customer_qty.html so if you added it yourself u must alter mailalerts.php to assign these var to the tpl file or of course just remove them.@+ Link to comment Share on other sites More sharing options...
Emiliano Carracedo Posted November 29, 2010 Share Posted November 29, 2010 HiI apply the maestrobo patch and works ok!Thank you!! Link to comment Share on other sites More sharing options...
nick_escu Posted December 1, 2010 Share Posted December 1, 2010 maestrobo's patch (the longer one) works well for me until now, thank you! Link to comment Share on other sites More sharing options...
diu1so Posted January 14, 2011 Share Posted January 14, 2011 I use Mail alerts v2.2.where should I change the alert to receive notifications about out of stock products?I would like to receive the alert when I have 3 products in stock, not when there's nothing in stock. Your help would be very appreciated. Link to comment Share on other sites More sharing options...
rocky Posted January 15, 2011 Share Posted January 15, 2011 Unless I'm misunderstanding you, this is a setting on the configuration page of of the module. It's the "Alert threshold", and it is 3 by default. Link to comment Share on other sites More sharing options...
chup Posted June 3, 2011 Share Posted June 3, 2011 Im having same issue at the momentrunning presta 1.4.2.5 and my mailalert module is 2.2i try to apply maestrobo's patch on modules/mailalerts/mailalerts.php but i couldn't find the code to replace anymore.anyone have a fix to this problem? Link to comment Share on other sites More sharing options...
pitus Posted July 8, 2011 Share Posted July 8, 2011 I found same issue as "chup" in PS 1.4.3The mailalert module have been modified in las release and the code has changed Link to comment Share on other sites More sharing options...
motnot Posted July 11, 2011 Share Posted July 11, 2011 Same hear. Any solutions??? Link to comment Share on other sites More sharing options...
HasseL Posted July 20, 2011 Share Posted July 20, 2011 Thanks ;-) Code works great in v 2.2.The alerts finally works Ok for my site :-) Link to comment Share on other sites More sharing options...
moony1234 Posted July 23, 2011 Share Posted July 23, 2011 Bump same issue here... Link to comment Share on other sites More sharing options...
alezzzzz Posted August 4, 2011 Share Posted August 4, 2011 My case is a bit more strange, when I receive the out of stock email the product is the wrong one .. either that or Im receiving random outofstock emails.. Presta 1.4.3 Mailaler 2.2 Link to comment Share on other sites More sharing options...
croogle Posted June 14, 2012 Share Posted June 14, 2012 have checked the SVN 1.3. version and didn't fix my problem. however, i found my own patch => please try it and see if it works for you: replace in modules/mailalerts/mailalerts.php $qty = intval(isset($params['product']['quantity_attribute']) AND $params['product']['quantity_attribute'] ? $params['product']['quantity_attribute'] : $params['product']['stock_quantity']); by $qty = intval((isset($params['product']['quantity_attribute']) AND is_int($params['product']['quantity_attribute'])) ? $params['product']['quantity_attribute'] : $params['product']['stock_quantity']); It worked. Thanks a lot. I use PS 1.4.8.2 Link to comment Share on other sites More sharing options...
Ggaivg Posted June 29, 2012 Share Posted June 29, 2012 Still the same problem... I have it set to warn at 3 yet it sends me warnings whenever a customer buys a product, so have disabled it now. Link to comment Share on other sites More sharing options...
petete2008 Posted May 24, 2013 Share Posted May 24, 2013 Solucionado!! hay que cambiar $qty = (intval(isset($params['product']['quantity_attribute']) AND $params['product']['quantity_attribute']) ? $params['product']['quantity_attribute'] : $params['product']['stock_quantity']); por $qty = intval((isset($params['product']['quantity_attribute']) AND is_int($params['product']['quantity_attribute'])) ? $params['product']['quantity_attribute'] : $params['product']['quantity']); Fijarse sobre todo en que hay que cambiar $params['product']['stock_quantity'] por $params['product']['quantity'] 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