I need to block the invoice creating code in Virtuemart 2.0 Paypal payment method plugin. How it possible ? please help me to do this.
Asked
Active
Viewed 311 times
0
-
Did you mean Order entry after successfull payment or Just need to block the invoice email send to the customer ? – Jobin Dec 09 '13 at 11:21
-
Yes..I mean the invoice creation is only after the successful payment of Order entry. – Sino Thomas Dec 10 '13 at 03:48
-
Which payapl plugin you are using default one with VM or another one that have payment option within your site? – Jobin Dec 10 '13 at 03:51
-
Presently i am using default paypal plugin with VM. – Sino Thomas Dec 10 '13 at 04:09
-
Then you can't block order creation before payment success. The default VM Paypal is works like, create order -> send to payapl -> success confirm order else cancel order – Jobin Dec 10 '13 at 04:20
-
If you need to place the order only after the successfull payment you have to check paypal plugin that pays within your site ie, accepting card details in your site and process via CURL . – Jobin Dec 10 '13 at 04:22
-
I don't need to block the order creation. I only need to insert the order details to invoices table only if the order status is confirmed. – Sino Thomas Dec 10 '13 at 04:57
1 Answers
0
In your Payment plugin section on backend.
Go to Paypal Payment option you will have three options.
PayPal Waiting -> Pending
PayPal Confirmed -> Confirmed
PayPal Cancelled -> Cancelled
here the waiting status you can consider while creating order time,
when the order creates it trigger the Paypal payment plugin with Pending
status you can trace that event on,
plugins\vmpayment\paypal\paypal.php
In this plgVmConfirmedOrder()
function get control with Pending
you can check whether status and avoid DB Query their.
Also triggering this function from cart.php helper
file inside confirmedOrder()
Hope its helps.

Jobin
- 8,238
- 1
- 33
- 52
-
I got another option,That is in the administrator/components/com_virtuemart/models/orders.php and the function createInvoiceNumber() add a new condition if($orderDetails['order_status'] == 'C'), In this the invoice created only if the order status is confirmed – Sino Thomas Dec 10 '13 at 10:34
-
When i block the createInvoiceNumber() using this condition if($orderDetails['order_status'] == 'C'), The order email not sending for the pending status orders. please give a solution to solve this issue. – Sino Thomas Dec 12 '13 at 12:23
-
instead of using if($orderDetails['order_status'] == 'C') check the paypal status too ie, once payment failed then only comes to this condition so already processed order do not enter inside condition – Jobin Dec 13 '13 at 02:07
-
Another option is just create an additional order status for failed orders and check that condition only then it will not effect any other condition – Jobin Dec 13 '13 at 02:08