HungryHungryHippos Posted July 6, 2012 Share Posted July 6, 2012 I hope someone can help me? I am operating Prestashop Version 1.4.8.2. I have the PayPal payment gateway module that came with the program. I have a couple issues here. When selecting a product and checking out normally, there is no problem. However, if I should use a voucher for a specific amount say $50.00, when posted in the cart the amount is $48 and some change not $50. If I should choose to continue anyway, when I get to the final phase of checking out, the voucher is subtracted and not totally used up and the cart goes into a fatal error. Can someone tell me if there is an easy fix for this, or what the problem might be? Thanks in advance, Steve Link to comment Share on other sites More sharing options...
HungryHungryHippos Posted July 6, 2012 Author Share Posted July 6, 2012 Hey again. After doing a little more testing with the vouchers, they all work except for the vouchers with a specific amount. The percentages and the free shipping work fine. Link to comment Share on other sites More sharing options...
SuperCharlie Posted July 7, 2012 Share Posted July 7, 2012 Ive got the same setup as you with 1.4.8.2 and paypal. I havent had any preset amounts for vouchers yet, just percentages..but Im wondering.. what do you have for the setting when setting up the voucher about what to do with whats left.. and.. is there any info other than fatal error? Like any programming details, can you tell what page is throwing it, maybe which module or any log errors? Just pre-solving as Im afraid I will probably run into this sooner or later as well. Link to comment Share on other sites More sharing options...
HungryHungryHippos Posted July 8, 2012 Author Share Posted July 8, 2012 I am told that is the voucher amount is not used up it will create a balance for the customer to use next time they purchase. This will happen until such time as the entire amount of the voucher has been used up. I have tested mine and the only part of the vouchers not working is the predetermined amount. The percentages and free shipping part work for me just not the fixed amount. Also when it goes into fatal error, it goes to a blank page on my site and just says fatal erro, no code given. I did speak with prestashop and they informed me that this issue would be fixed in Prestasho version 1.5 when it is released. Link to comment Share on other sites More sharing options...
SuperCharlie Posted July 8, 2012 Share Posted July 8, 2012 A quick update.. I restored my live site to my development area and tested this. This is an error and an issue as you noted as I reproduced it exactly as you described. I will see if there is something I can code up to solve this, no promises, but I will be working on it today. I noticed a few things so far in testing. 1. If the voucher amount is more than the cart amount it will fatal error no matter what the behavior. 2. If the voucher amount is less than the cart amount it appears not to fail, however, with my setup so far I have not completely validated this. It appears to be that processing a $0 cart crashes the paypal module. That is the tack I am taking at present. This issue can not be left for 1.5 as I am not sure I will be upgrading any time in the near future. I will post further updates or a fix when I come up with them. 1 Link to comment Share on other sites More sharing options...
HungryHungryHippos Posted July 8, 2012 Author Share Posted July 8, 2012 Thanks and let me know what you come up with. I am new at this and do not know how to write much code but I have been trying lol. I can not go live until this is resolved and I would prefer to stay at 1.4.8.2 until all bugs are worked out of 1.5 Link to comment Share on other sites More sharing options...
SuperCharlie Posted July 9, 2012 Share Posted July 9, 2012 Here is an update..no solution yet. I found a crumb as to where the problem is coming from but not the source quite yet.. being a noob at this, it is taking a while to track down all the rabbit holes PS jumps through to make its magic happen. In the file /controllers/ParentOrderController.php around line 156 or so is this. protected function _checkFreeOrder() { if (self::$cart->getOrderTotal() <= 0) { $order = new FreeOrder(); $order->free_order_class = true; // error here $order->validateOrder((int)(self::$cart->id), Configuration::get('PS_OS_PAYMENT'), 0, Tools::displayError('Free order', false), null, array(), null, false, self::$cart->secure_key); return (int)Order::getOrderByCartId((int)self::$cart->id); } return false; } The function validateOrder under the "// error here" I added is what is failing but I havent found that function yet. If I remark that line it tries to go to paypal.. but thats not really what needs to happen. I realized that this isnt really linked to paypal or vouchers.. it is simply choking, as I had suspected, because the cart value is 0. I just tried creating a $0 product with $0 shipping, no voucher, and got the same fatal error result. In other words, no matter what pay module you use, and regardless of vouchers or anything else, if you have a cart and the total is $0, when the client tries to complete the transaction, PrestaShop will have a fatal error. I ended up with a massive headache and gave up for today. More hunting in a day or two as tomorrow is my birthday and Im not beating my head on this for that 1 Link to comment Share on other sites More sharing options...
tank Posted July 9, 2012 Share Posted July 9, 2012 I have the same problem Fatal error............. like you said it appears to happen when cart = $0 I was trying to ship something for free to a customer by Using a 100% off coupon and a Free shipping coupon. Link to comment Share on other sites More sharing options...
SuperCharlie Posted July 11, 2012 Share Posted July 11, 2012 Well.. I decided ta add this to the bug tracker and found a couple things. First, its already in there. Second, the error stems from exactly where I thought in that function ans under any $0 cart instance or negative amount. Third, unless I am mistaken, this is all I can find about the fix, a quote from another 1.4 user: As per Damien METZGER said "Was already fixed in 1.5" The bug is listed as fixed but I cant seem to find the update for 1.4 Surely..surely.. they wouldnt let this bug live in all the 1.4.x's out there.. surely.. Throw us 1.4.8.2 people a bone here guys.. Here is a bug tracker link saying its fixed.. (resolved) http://forge.prestas...owse/PSCFI-5814 Link to comment Share on other sites More sharing options...
HungryHungryHippos Posted July 12, 2012 Author Share Posted July 12, 2012 well hopefully they will give us an idea on how to fix it. I dont want to upgrade to 1.5 until they have all the bugs worked out of that version. Link to comment Share on other sites More sharing options...
ciptanegara Posted July 12, 2012 Share Posted July 12, 2012 i had a problem too. fatal error because of downloadable product ..when the shopping cart goes to zero --> fatal error. when it goes with a price, not error..it works perfectly. in case that happen, you may take a look this thread http://www.prestashop.com/forums/topic/173085-solved-free-order-fatal-error-1482/ Link to comment Share on other sites More sharing options...
HungryHungryHippos Posted July 13, 2012 Author Share Posted July 13, 2012 I replaced with the information in the thread, however it did work but did not give the remaining value of the voucher. So if the voucher is $50.00 and the product is $5.00, there should be a balance of $45.00. With the code from the link, it uses the whole voucher and does not give any amount back. As I said I am not real good with writing the codes but there might be somewhere else that needs a modifications also. Link to comment Share on other sites More sharing options...
Am1g0 Posted July 13, 2012 Share Posted July 13, 2012 Comment out this part in classes/PayMentModule.php (validateOrder function) if (!$this->active) die(Tools::displayError()); Free order will work again... Link to comment Share on other sites More sharing options...
Henrik Pantle Posted August 22, 2012 Share Posted August 22, 2012 (edited) Comment out this part in classes/PayMentModule.php (validateOrder function) if (!$this->active) die(Tools::displayError()); Free order will work again... is this true?? i also found http://forge.prestashop.com/browse/PSCFI-5887 THANK YOU!! it did so, and i go through ... but what does that mean for "production"?? $cart = new Cart((int)($id_cart)); // Does order already exists ? /* if (!$this->active) die(Tools::displayError()); */ i also found http://forge.prestashop.com/browse/PSCFI-5887 Edited August 22, 2012 by eltnap (see edit history) Link to comment Share on other sites More sharing options...
benjamin utterback Posted August 22, 2012 Share Posted August 22, 2012 Hello eltnap, What do you mean when you say "production" I can not see that option. Did this thread help you solve your problem? Thank you for choosing PrestaShop! Link to comment Share on other sites More sharing options...
Guest locen Posted December 15, 2015 Share Posted December 15, 2015 (edited) Hi, I have an error with the voucher, this happens only with YEN .. I attached a photo where I explain all Edited December 15, 2015 by locen (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts