Hi,
This last question it is not really about the javascript events, but it can be if we do it , but I wanted to keep the discussion in the same place, because it is related with the plugin I create and with the previous questions. I hope it is okay.
So now, in the last step, I need to get all the informations about the order that was created.
First I was thinking to use onAfterOrderConfirm function, but I saw that the function is not triggered, and I found this:
The onAfterOrderConfirm trigger is a trigger only available for payment plugins and which will be called only for the payment plugin that has been selected by the customer.
#211085
(in my opinion, this should be in the documentations )
So because my plugin is not a payment plugin, and it will not be used by the client, I can't use onAfterOrderConfirm in my plugin.
Now I'm think that my next best options are onAfterOrderCreate and onAfterOrderUpdate(&$order,&$send_email).
So basically, now I have to check if inside the onAfterOrderCreate(&$order,&$send_email) the status of the order is confirmed and do my things here.
Or, to do the same thing in onAfterOrderUpdate(&$order,&$send_email), when the status is changed manualy in the administrator, but is this gonna work if the status it is changed by the payment confirmation?
Can we push this as a javascript event with params, or can you suggest another approach?
What I need to do is to run some JS with that information from the order, I run js on every situations I discused untill now , when add a product in cart, when remove, when change quantity and when I place the order now.
Example:
_nzm.run( 'require', 'ec');
_nzm.run( 'set', 'currencyCode', 'EUR' );
_nzm.run( 'ec:addProduct', {
'id': 'product_id',
'name': 'product_name',
'price': '84.00',
'quantity': '1'
} );
_nzm.run( 'ec:setAction', 'purchase', {
'id': '758',
'revenue': '84.00',
'tax': '0',
'shipping': '4.00'
} );
_nzm.run('send', 'pageview');
Thank you for your time!