News:

Looking for documentation? Take a look on our wiki

Main Menu

Plugin method before order success

Started by Kuubs, June 30, 2020, 13:07:34 PM

Previous topic - Next topic

Kuubs

Hello,

I have a plugin but I need to add an extra check before the order is confirmed so that everything goes okay. What is the method for the plugin to fire before the order is succeeded? I have now plgVmConfirmedOrder but that still goes through.

   $cart->_confirmDone = FALSE;
$cart->_dataValidated = FALSE;
$cart->setCartIntoSession();
return FALSE;


Is this the correct code to send the customer back to the cart with an error?
         

Customer presses confirm order, my plugin needs to check certain things, if success, go through, if not return to cart page.

AH

Yes plgVmConfirmedOrder is triggered after the order is written to the tables

you could check earlier using

plgVmDisplayListFEPayment


You could go this way but -

What is the check

Because you may be able to do it easier in JS as a cart override and not display the confirm button until your "status" is met.


Difficult to guess my way through this


Regards
A

Joomla 4.4.5
php 8.1

Kuubs

Quote from: AH on June 30, 2020, 18:06:06 PM
Yes plgVmConfirmedOrder is triggered after the order is written to the tables

you could check earlier using

plgVmDisplayListFEPayment


You could go this way but -

What is the check

Because you may be able to do it easier in JS as a cart override and not display the confirm button until your "status" is met.


Difficult to guess my way through this

I need to check it server side for better security. I used plgVmOnCheckoutCheckDataShipment