be_tnt Posted February 11, 2013 Share Posted February 11, 2013 Hello! I have added a virtual product to my shop; I have seen that in mail folder, there is a download_products template. I have added the virtual product in my cart and paied for it but I did not receive the email with the link to download it. The link is only available in the customer area (which is not practical). Is there something to do to be sure this mail with the link will be sent? 1 Link to comment Share on other sites More sharing options...
gonebdg - webindoshop.com Posted February 11, 2013 Share Posted February 11, 2013 Set order status to "Payment Accepted" Email with Link download should be sent automatically. Make sure the e-mail template is available on your prestashop installation directory http://domain.com/mails/en/download_product.html Link to comment Share on other sites More sharing options...
be_tnt Posted February 12, 2013 Author Share Posted February 12, 2013 hello, the status is "payment accepted" as the payment is made by paypal. Could it be an issue with the paypal module (I am using the free one and this would not be the first issue with this module) Link to comment Share on other sites More sharing options...
gonebdg - webindoshop.com Posted February 12, 2013 Share Posted February 12, 2013 What is your Prestashop version ? Link to comment Share on other sites More sharing options...
be_tnt Posted February 12, 2013 Author Share Posted February 12, 2013 PS 1.5.3.1 Link to comment Share on other sites More sharing options...
DzienDobry Posted February 13, 2013 Share Posted February 13, 2013 I wanted to test downloadable products but it does not work at all. When I check 'payment accepted' the customer receives no mail with downloadable file link... How to do it? Quantity was 1, order is placed as it should be Link to comment Share on other sites More sharing options...
DzienDobry Posted February 13, 2013 Share Posted February 13, 2013 (edited) Anyone? no delivery of link to downloadable file Product info: Edited February 13, 2013 by DzienDobry (see edit history) Link to comment Share on other sites More sharing options...
gonebdg - webindoshop.com Posted February 14, 2013 Share Posted February 14, 2013 PS 1.5.3.1 Bug ... Open and Edit file ../classes/order/OrderHistory.php Replace : if ($virtual_products && (!$last_order_state || !$last_order_state->logable) && $new_order_state && $new_order_state->logable) With : if ($virtual_products && (!$last_order_state || !$last_order_state->logable || ($last_order_state->id == $new_order_state->id) && $new_order_state && $new_order_state->logable)) Link to comment Share on other sites More sharing options...
DzienDobry Posted February 14, 2013 Share Posted February 14, 2013 Bug ... Open and Edit file ../classes/order/OrderHistory.php Replace : if ($virtual_products && (!$last_order_state || !$last_order_state->logable) && $new_order_state && $new_order_state->logable) With : if ($virtual_products && (!$last_order_state || !$last_order_state->logable || ($last_order_state->id == $new_order_state->id) && $new_order_state && $new_order_state->logable)) it kind of worked... now when customer buys the product he gets the link before payment - that is not good 1 Link to comment Share on other sites More sharing options...
be_tnt Posted February 14, 2013 Author Share Posted February 14, 2013 thx gonebdg - webindoshop.com but would it not be better to override the classe instead of modifying it directly? Any idea if there is a bug reported on the PS bug system? Link to comment Share on other sites More sharing options...
gonebdg - webindoshop.com Posted February 14, 2013 Share Posted February 14, 2013 hmmm ... then this should be work but the status "Payment Accepted" should have id = 2 if ($virtual_products && ($last_order_state->id == 2)) AND Yes, you should overriden the function addWithemail. Just add the new function addWithemail (the modified one) OR download the attached file and upload into /override/classes/order/OrderHistory.php OrderHistory.php 1 Link to comment Share on other sites More sharing options...
DzienDobry Posted February 15, 2013 Share Posted February 15, 2013 It did more terrible dmage to the rest of the shop I had to reinstall it. http://www.prestashop.com/forums/topic/225400-white-screen-after-purchase/ When customer does the check out he get's the white screen. I used it ( http://www.prestashop.com/forums/topic/224525-how-to-get-debug-information-for-500-error-or-blank-page/page__p__1104709#entry1104709 ) to get the error description [PrestaShopException] Property OrderDetail->id_warehouse is empty at line 837 in file classes/ObjectModel.php 831. 832. $message = $this->validateField($field, $this->$field); 833. if ($message !== true) 834. { 835. if ($die) 836. throw new PrestaShopException($message); 837. return $error_return ? $message : false; 838. } 839. } 840. 841. return true; ObjectModelCore->validateFields - [line 264 - classes/ObjectModel.php] - [0 Argument] ObjectModelCore->getFields - [line 464 - classes/ObjectModel.php] - [0 Argument] ObjectModelCore->add - [line 426 - classes/ObjectModel.php] - [2 Arguments] ObjectModelCore->save - [line 579 - classes/order/OrderDetail.php] - [0 Argument] OrderDetailCore->create - [line 603 - classes/order/OrderDetail.php] - [7 Arguments] OrderDetailCore->createList - [line 283 - classes/PaymentModule.php] - [7 Arguments] PaymentModuleCore->validateOrder - [line 64 - modules/bankwire/controllers/front/validation.php] - [9 Arguments] BankwireValidationModuleFrontController->postProcess - [line 158 - classes/controller/Controller.php] - [0 Argument] ControllerCore->run - [line 348 - classes/Dispatcher.php] - [0 Argument] DispatcherCore->dispatch - [line 28 - index.php] - [0 Argument] order was placed but no email sent to the buyer After accepting the payment the buyer gets mail 'Payment accepted' but no email with link. So I decided to implement your fix again download the attached file and upload into /override/classes/order/OrderHistory.php you file has only 100 line and one function and tried my best to replace lines in my order.php with yours. Created another virtual product, bought it after confirmation of order the buyer saw: [PrestaShopException] Property OrderDetail->id_warehouse is empty at line 837 in file classes/ObjectModel.php 831. 832. $message = $this->validateField($field, $this->$field); 833. if ($message !== true) 834. { 835. if ($die) 836. throw new PrestaShopException($message); 837. return $error_return ? $message : false; 838. } 839. } 840. 841. return true; ObjectModelCore->validateFields - [line 264 - classes/ObjectModel.php] - [0 Argument] ObjectModelCore->getFields - [line 464 - classes/ObjectModel.php] - [0 Argument] ObjectModelCore->add - [line 426 - classes/ObjectModel.php] - [2 Arguments] ObjectModelCore->save - [line 579 - classes/order/OrderDetail.php] - [0 Argument] OrderDetailCore->create - [line 603 - classes/order/OrderDetail.php] - [7 Arguments] OrderDetailCore->createList - [line 283 - classes/PaymentModule.php] - [7 Arguments] PaymentModuleCore->validateOrder - [line 64 - modules/bankwire/controllers/front/validation.php] - [9 Arguments] BankwireValidationModuleFrontController->postProcess - [line 158 - classes/controller/Controller.php] - [0 Argument] ControllerCore->run - [line 348 - classes/Dispatcher.php] - [0 Argument] DispatcherCore->dispatch - [line 28 - index.php] - [0 Argument] But order was made and I see it in BO Payment accepted , 'payment accepted' mail received, no mail with link.. pleasehelp... Link to comment Share on other sites More sharing options...
gonebdg - webindoshop.com Posted February 16, 2013 Share Posted February 16, 2013 @DzienDobry Read my post above with CAREFULLY ! Do Not try to modify your prestashop by your own if you doesn't understand how to do it 1 Link to comment Share on other sites More sharing options...
betgooru Posted February 17, 2013 Share Posted February 17, 2013 Hello, Still not working correctly, after Your fix when I click Payment accepted by myself then it's working but if the other payment processor is sending this commend the mail with download link is not sending :S Link to comment Share on other sites More sharing options...
gonebdg - webindoshop.com Posted February 17, 2013 Share Posted February 17, 2013 Hello, Still not working correctly, after Your fix when I click Payment accepted by myself then it's working but if the other payment processor is sending this commend the mail with download link is not sending :S what is the payment module that you've used? i'm just testing it with bank wire payment module where the status order "payment accepted" should be set manually Link to comment Share on other sites More sharing options...
WooF Posted February 18, 2013 Share Posted February 18, 2013 (edited) Hi PrestaShop Addict, thank you for your advice. Now I get all four mail's in next order (bank wire - waiting for payment, Order details, Download product, Payment excepted) I would like that order of mails costumer get is (bank wire - waiting for payment, Order details, Payment excepted, Download product) Please how that could be done. I already try to change the number in this line: if ($virtual_products && ($last_order_state->id == 2)) but then I don't get the Download product mail. Best regards David Edited February 18, 2013 by WooF (see edit history) Link to comment Share on other sites More sharing options...
cyberdinu Posted March 24, 2013 Share Posted March 24, 2013 Bug ... Open and Edit file ../classes/order/OrderHistory.php Replace : if ($virtual_products && (!$last_order_state || !$last_order_state->logable) && $new_order_state && $new_order_state->logable) With : if ($virtual_products && (!$last_order_state || !$last_order_state->logable || ($last_order_state->id == $new_order_state->id) && $new_order_state && $new_order_state->logable)) worked for me! thanks a lot! the problem now is that I can't download large files from prestashop, also not possible from backoffice, download stops after 60-80Mb. When downloading the file directly from server, it's ok. Link to comment Share on other sites More sharing options...
CodeDog Posted March 25, 2013 Share Posted March 25, 2013 Hi, We're having the same issue, customer is not receiving a download email for virtual products. I applied the above code change, but it doesn't seem to be making any difference. We've tried purchasing using Pay by Check and using a voucher with the same results. We get all other emails, but not the download email. Apparently the fix above worked for everyone else, is there something I missed in this thread besides the single line code change in OrderHistory.php? PrestaShop 1.5.3.1 Thanks... Link to comment Share on other sites More sharing options...
gonebdg - webindoshop.com Posted March 25, 2013 Share Posted March 25, 2013 @WooF Please read my post #11 again @cyberdinu Please check ../controller/GetFileController.php line-281 , and try to increasing the fgets "maximum line length" value (default = 16384) echo fgets($fp, 16384); @CodeDog Please try it first with default bankwire payment module and disable the others payment module especially payment module from 3rd party Link to comment Share on other sites More sharing options...
CodeDog Posted March 25, 2013 Share Posted March 25, 2013 (edited) Thanks, gonebdg, but it didn't make any difference. Disabled all other payment options and tried bank wire, but got the same thing. What did work was creating an Order Status using the template "download_product", but only when using a payment method that requires approval in the back office so we can choose that Status. Now all I need to know is how to make virtual products use that status when customers use an automated payment method like PayPal, and we'll be all set... Edited March 25, 2013 by CodeDog (see edit history) Link to comment Share on other sites More sharing options...
enovo Posted May 2, 2013 Share Posted May 2, 2013 Hello, someone could resolve this problem? I have Prestashop 1.5.4.1 version and I have the same problem. The examples in this forum is for old version, any idea how to resolve? thanks! Link to comment Share on other sites More sharing options...
enovo Posted May 3, 2013 Share Posted May 3, 2013 here the solution for the last version: http://forge.prestashop.com/browse/PNM-1355?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel Link to comment Share on other sites More sharing options...
GingerDesign Posted April 30, 2014 Share Posted April 30, 2014 Hmmm... I just tested mine... I registered as a customer, bought something, payed via Paypal... got the email but there is no download link for the product I bought... not in the email and not in the My Account area... only thing I can download is the invoice... does anyone got an answer for me???? Link to comment Share on other sites More sharing options...
PatriceJV Posted October 4, 2018 Share Posted October 4, 2018 The problem with this override is that it do not works Paypal or other payment type. 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