News:

Looking for documentation? Take a look on our wiki

Main Menu

Virtuemart initial order_status modification and PayPal

Started by giannispsar, April 12, 2010, 07:46:47 AM

Previous topic - Next topic

giannispsar

Hello everybody,
as far as i have understood PayPal works in the followinf way:
When a user places an order, an order is being added in the virtuemart database and the order status is set to Pending (by virtuemart).
Afterwards the user is redirected to Paypal site.
If the user cancels the order and returns to the site then Paypal sends an IPN message that updates the order status of the order to Cancelled.
If the user pays for his order Paypal sends an IPN message that changes the order status to Confirmed.
My problem is the following:
If i change the initial order status that is set by virtuemart in ps_checkout.php from pending to Uncomplete, then virtuemart is NOT redirecting the user to paypal site after he places the order in my site. I suppose that there must be somewhere in virtuemart code a condition that only if the initial order_status is Pending then virtuemart redirects user to PayPal website.
I need to change this, because i want to distinguish the following conditions:\
A.A user completes succesfully an order (he also pays in paypal). That works fine.
B. A user cancels an order as soon as he visits Paypal website. That works fine.
C. A user places an order but when he is redirected to paypal website he jusr pushes the back button and returns to my joomla site. This is my problem because the order stauts remains Pending and not cancelled.

So, if i could initially set the order status to Uncomplete, everything would be ok. As i told, i can do this in ps_checkout.php but then the user is NOT redirected to paypal website.

Could anybody give me some hint?