No order confirmaiton email sent after checkout via PayPal

General discussion about InteraMind products. For specific products, please post in the specific product forum,

Moderators: presman, tzvi, harelguy

No order confirmaiton email sent after checkout via PayPal

Postby presman » Thu Jun 20, 2013 4:29 pm

Problem description:
VirtueMart 2 does not send an order confirmation email when you checkout via PayPal.
PayPal payment module in VirtueMart 2 sends only the "order status changed" email after PayPal notify (callback) that the payment was successful.

Solution:
If you want your system to send the order confirmation even when the order is "pending" and the payment was not done yet, you should modify the PayPal plugin file. It is a very simple change.

You can find the modified file and download it here:

PayPal payment method file

I suggest to make the following code changes in the following file:

/plugins/vmpayment/paypal/paypal.php

The new code should be added in a function named: plgVmConfirmedOrder

At the end of the function around line 284. You need to add the following code:

Code: Select all
$modelOrder = VmModel::getModel ('orders');
$order['order_status'] = $this->getNewStatus ($method);
$order['customer_notified'] = 1;
$order['comments'] = '';
$modelOrder->updateStatusForOneOrder ($order['details']['BT']->virtuemart_order_id, $order, TRUE);


Moreover, you need to add this extra function:

Code: Select all
function getNewStatus ($method) {
   if (isset($method->status_pending) and $method->status_pending!="") {
      return $method->status_pending;
   } else {
      return 'P';
   }
}


That's it, you are all set :-)

Enjoy,
Joel
http://www.Interamind.com
Everything you need for your VirtueMart store
presman
Site Admin
 
Posts: 255
Joined: Wed Jun 03, 2009 9:16 am

Re: No order confirmaiton email sent after checkout via PayP

Postby hurrionz » Fri Nov 08, 2013 7:08 pm

Hi, I tryed your hack (thank you very much for it) and it worked partially.

both the customer and the merchant receive the confirmation email (with pending status) as the customer click on "buy" (before to reach paypal).
When the order is really completed, nor the customer nor the merchant receive the confirmation.

Would be the best if the mail would be sent only when the payment is really completed.
Do you know how to fix it?

Thank you!
hurrionz
 
Posts: 1
Joined: Fri Nov 08, 2013 6:56 pm

Re: No order confirmaiton email sent after checkout via PayP

Postby hello_kitty » Wed May 07, 2014 10:34 am

In my case it worked quite well. Thanks for sharing.

_______________________________________________________________________
lpg conversion prices, wniosek o dotacje unijne, wieliczka salt mine, restaurants krakow, PDF software
hello_kitty
 
Posts: 3
Joined: Wed May 07, 2014 10:31 am

Re: No order confirmaiton email sent after checkout via PayP

Postby alivemedia » Thu Jun 26, 2014 2:28 am

It works as far as sendng an email both to the customer and to the admin saying pending order and then sending on to Paypal. The only thing that would be better would be if it would send a confirmation email to both the customer and the admin after payment. Right now it is not doing that. Any hacks for that?
alivemedia
 
Posts: 1
Joined: Thu Jun 26, 2014 2:15 am

Re: No order confirmaiton email sent after checkout via PayP

Postby presman » Thu Jun 26, 2014 7:53 am

Hi,
The first post in the thread has the hack you need to make in the code.

Thanks,
Joel
Joel
http://www.Interamind.com
Everything you need for your VirtueMart store
presman
Site Admin
 
Posts: 255
Joined: Wed Jun 03, 2009 9:16 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

Automated Email Marketing for VirtueMart
cron