News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Order Confirmation Emails before Successful PayPal Payment

Started by rupesh1989, January 18, 2012, 08:50:21 AM

Previous topic - Next topic

rupesh1989

I've discovered that when a customer goes through the payment process, they complete the checkout process by "confirming order" and being redirected to PayPal.

Regardless of whether or not they make a successful payment, both the prospective buyer and our client, who processes the orders, receives an order confirmation email.

Is there any way to set Virtuemart to only send this email once they have made a successful payment? It's really a must-have for us.

Thank you for your help,
rupesh

juagicre

yes... this should be definetly an option... but while this gets done, just a question: where can we find this line of code that sends the order mail?

stinga

Loads of other have made various fix's for this, have search there are even instructions on the net for it, try google.

Edit 1:
I think the best place to move it to would be when notify.php is called (or whatever you payment gateway is).
Just need to find the function that gets called, remove it from where it is and move it else where.

vmMail is what sends the email and it is currently called from ./administrator/components/com_virtuemart/classes/ps_checkout.php.

Edit 2:
email_receipt is the name of the function that sends the email and it takes the order id as the only parameter.
It is called from add which I am going to assume adds the order to the system.

So I think you could comment that out and add it into notify.php or a common routine in there some where.
Stinga.
614869 products in 747 categories with 15749 products in 1 category.
                                             Document Complete   Fully Loaded
                Load Time First Byte Start Render   Time      Requests      Time      Requests
First View     2.470s     0.635s     1.276s          2.470s       31            2.470s      31
Repeat View  1.064s     0.561s     1.100s          1.064s       4             1.221s       4

jenkinhill

Quote from: stinga on January 19, 2012, 17:04:58 PM
vmMail is what sends the email and it is currently called from ./administrator/components/com_virtuemart/classes/ps_checkout.php.

Not for VM2 - there is no classes directory...
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

rupesh1989

hi jenkinhill ,

U r right there is no classes folder in VM2  :'(, but then can you please tell me where to do changes so that purchase order emails send to both owner and customers!
In which file we have to do changes so that it works! i 'm using joomla 1.7.3 with VM2!

muasif80

//    2 = don't delete the cart, don't send email and don't redirect
   return $this->processConfirmedOrderPaymentResponse(2, $cart, $order, $html, $new_status);

I have seen this at line no 242 and 243 of paypal payment plugin. This means they are passing 2 as hardcoded value here and it is meant for not sending out the email. The email is sent out inside the function processConfirmedOrderPaymentResponse when 1 is passed. Virtuemart people can confirm this. But this is my understanding.
1. Expertise: PHP and JAVA Expert (SCJP)
2. DEV Tools: Eclipse PDT - WAMP - XDebug
3. www.mayotitech.com/products.php

stinga

Stinga.
614869 products in 747 categories with 15749 products in 1 category.
                                             Document Complete   Fully Loaded
                Load Time First Byte Start Render   Time      Requests      Time      Requests
First View     2.470s     0.635s     1.276s          2.470s       31            2.470s      31
Repeat View  1.064s     0.561s     1.100s          1.064s       4             1.221s       4

Everlast

Hi, Repesh. Sorry for the late response, but did you ever find a solution for this?

I'm using Multisafepay. And VM is already sending an e-mail confirming an order when the user is still selecting a payment method. The e-mail has to be sent AFTER the payment, not before :P I guess that's common knowledge, but VM apparently doesn't think that way =p

Carl Henry

Hello,

Re: Virtuemart 1.1.9

This might help some one out;

In file: ps_checkout.php
Line 2252

I commented out (//) this line to stop the emails being sent:

$shopper_mail = vmMail( $from_email, $mosConfig_fromname, $shopper_email, $shopper_subject, $shopper_mail_Body, $shopper_mail_AltBody, true, null, null, $EmbeddedImages);

The customer will receive a confirmation from the payment processor (by email) and if you change the status and 'Notify The Customer' they will receive an email from the system.

I hope this helps you,

Regards,

Carl Henry
Carl Henry Global
Carl Henry Global - Website Design and Online Marketing information - An online information resource for everything to do with building websites, developing websites, upgrading websites, managing websites, marketing websites, eBooks & eReports and selling your products & services online.

http://www.carlhenryglobal.com