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 email sent before PayPal payment processed

Started by davidm, May 01, 2008, 12:57:41 PM

Previous topic - Next topic

jaddi01

Just to let you guys know, if you have issues where the subtotal is displaying inc VAT/TAX and the tax for shipping is not being added on the Invoice email (as was the case with me)

eg.

, use the following threads:

https://forum.virtuemart.net/index.php?topic=48981.0
http://forum.virtuemart.net/index.php?topic=46209.0

Basically edit the ps_send.invoice.php replacing the following code:
Replace this:

} else {
$sub_total += ($dboi->f("product_quantity") * $dboi->f("product_final_price"));
$shopper_message .= $CURRENCY_DISPLAY->getFullValue($dboi->f("product_item_price"), '', $db->f('order_currency'));
}

with

} else {
$sub_total += ($dboi->f("product_quantity") * $dboi->f("product_item_price"));
$shopper_message .= $CURRENCY_DISPLAY->getFullValue($dboi->f("product_item_price"), '', $db->f('order_currency'));
}


and...

$order_shipping = $db->f("order_shipping");
$order_shipping_tax = $db->f("order_shipping_tax");
$order_tax = $db->f("order_tax");

to this

$order_shipping = $db->f("order_shipping");
$order_tax = $db->f("order_tax") + $db->f("order_shipping_tax");


Hope this helps someone in the same position.

John

ladumeni

I found that there have been some discussions already about when to send the confirmation email to the buyer. This thread  invokes similar objectives:

http://forum.virtuemart.net/index.php?topic=24147.0

The solution in this thread works correctly but is in my opinion incomplete. A client who clicks on the "confirm order" button will instantly have his transaction saved, the articles "In Stock" amount   reduced his cart emptied and the confirmation email sent. Thanks to Datatonic the email isn't sent any more but a customer who hits the back button before finishing the payment will return to the site with an empty cart (reducing the stock in the shop)  and plenty of confusion ...

For those (as I am) who are only interested in the orders actually paid by the customer, the final checkout process (registering the transaction, reduce stock etc.) should only be triggered once the confirmation from paypal received. I noticed this bug report which has similar comments:

https://dev.virtuemart.net/cb/issue/2625

I analyzed how this could be implemented and would like some feedback from the Virtuemart team about feasibility.
New checkout process:

1)Configuration option in the admin "Payment Method Form" when "HTML-Form based (e.g. PayPal)" is selected :

=> "Generate Transaction on confirmation only"

2)If option 1) is selected the "confirm order" form is taken from the "Payment Extra Info" instead of generating the form with the
<input type="hidden" name="func" value="checkoutProcess" />.

The form is directly posted to https://www.paypal.com/cgibin/webscr

3)On confirmation by paypal (notify.php) the checkout process is triggered through the usual ps_checkout->process() function.

The change in core files should be miner. As I need this for my clients and possible other payment modules I will have to implement it. If other people (and the Virtuemart team) think this feature is worthwhile I would be happy to hear any suggestions/compatibility issues  in order to eventually have this incorporated to Virtuemart (instead of posting "hacks").

Cheers,

Larsen

alldigit

Well, believe it or not i read all 6 pages of this thread.  And thank you in the last post which linked to the developers posting where it appears the decision has been made to do nothing to address this.  I don't understand.  I have never seen another shopping cart behave this way.

Could a VM representative please post here your official stance on this topic so that we can make a decision and inform our clients if a solution will come from VM, private programmer or selecting another cart.  What a crazy use of time to have to read through 6 pages of post to find out that VM developers plan to do nothing.  At least one of the developers in the developers forum recognizes that there are Angry Users out there.  Thank you for your concern and recognizing that communication will help.
Using Joomla 1.5.4 and VirtueMart 1.1.1

Datatonic

Larsen - I'm a bit clearer now and about to do some more joomla sites with ecommerce involved so might look at tackling this at some point.

Alldigit - that's the rub with Open Source.  If you send me a pm or post on here what you are looking to achieve, you never know, I or someone else might have a solution.

Ro.

alldigit

Thank you datatonic, i've passsed the info on to my client for him to consider.
Using Joomla 1.5.4 and VirtueMart 1.1.1

ladumeni

As I still haven't received any answer from virtuemart team (I also pm the dev responsible) i'll go ahead and do as I think best. I'll have a solution ready in about 3 weeks (off for vacation tomorrow ;) ) and will be glad to share it here.

Datatonic - If you have any suggestions to the points of entries (I would like this "hack" to work for other HTML post based payement methods) just let me know. I'm guessing using the form pasted in the DB is the way to go ....

quantum_leap

Good luck, I am also waiting for a solution to that problem!
Joomla! 1.5.15, VirtueMart 1.1.4 stable

techmatters

A big thanks to Datatonic for your work so far on this issue.
Ladumeni, you have very clearly expressed the process that needs to happen. Both I and many other VM users will be waiting for your solution. Thank you for your generosity and willingness to share this with others.

We worked exclusively with oscommerce in the past and battled through this very same issue of "what" is handled "when" with Paypal's IPN, but oscommerce got this sorted out years ago (exactly as Ladumeni described). After "upgrading" our ecommerce offerings with VM, I am surprised to find these sorts of processes poorly thought out. The way the currency converter works is another similar problem (but not one for this discussion  ;) )

Thank you both again, for your professional approach to this problem. We ALL look forward to your solution.

Joomla! 1.5.11, VirtueMart 1.1.3 stable

Pjries

I'm also looking forward to a solution to this and very grateful for all of the work you're doing. Reading through the developers comments about this issue, it may be a misunderstanding on their part of how some merchants want to operate. 

Just because an order is placed, doesn't mean that a payment will be made, no matter how much integrity we may assume a shopper has. Lots of online carts are abandoned before payment and the way this cart works makes it even easier to do that, at least when using PayPal as the payment option.

It is, as others have said, confusing for shoppers who have completed their payments, to come back to their e-mail inbox to find that their order is "Pending".  For one of my clients, we just commented out the status in the "Purchase Order" which we have renamed Order Confirmation.  We could also add some explanation for why that e-mail has been sent, in the template. But it does make more sense, to have the option of sending the detailed order information *after* payment is confirmed by PayPal, rather than before.

It really is a shame that the developers don't agree, but it's gratifying that the community is able to respond in the way you all have. Many, many thanks to all of you for all of your efforts.

jaddi01

I can only agree!  If the dev's disagree it won't get done. Then again, I cannot understand their reservations at all.  It seems so logical to do it the way we are asking.  Funny how community driven projects are only community projects when it suits.


ralphonz

Wow, thats alot of reading....

Any solution yet for no email being sent until order is confirmed?

Also i would like to mention here that when selling downloads, that order status is remaining on 'Pending' even after payment with paypal is completed and the confirmed?  This means the status has to be changed manually for every order.

Looking forward to a solution soon - thanks for everyones work so far.

ladumeni

Ok, so I went ahead an implemented a "patch" for modifiyng the checkout process as described earlier.

As this patch is a bit out of scope from the original thread we've added a dedicated page to our site: http://www.b-planet.com/VirtueMart/paypal-patch.html

Please use our forum for any additional information : http://forum.b-planet.com/viewforum.php?f=4

I've tested it throughly on the sandbox system and it works very well for me. I don't have a production evironment handy right now but shouldn't make any diffrence.

Cheers

Larsen



jaddi01

Great stuff!  Looks good.  I'm presuming this patch will work with all Paypal related payment processors that use the virtuemat HTML (paypal or similar) option?  At least I hope so as I'm using my own SagePay module.

ladumeni

The patch should work with any payement method, but the php code in the payement extra info needs modifications to work ....