- Posts: 149
- Thank you received: 6
User Feedback from an Order Status Change?
5 years 3 days ago - 5 years 3 days ago #335864
by icomex
User Feedback from an Order Status Change? was created by icomex
-- HikaShop version -- : 4.4.3
-- Joomla version -- : 3.10.2
-- PHP version -- : 7.4.23
My latest custom PaymentPlugin uses onBeforeOrderUpdate to contact our gateway provider to capture funds (which were pre-authorized during the Order Creation) whenever the order is later changed from status 'created' to 'shipped' or 'confirmed'. This status change is executed from the Orders List Admin page, so the process is actually executed in a Modal Window. Because of this, the Order listing is not reloaded after the method is finished. To view the actual changes made while changing the status, I have to reload the page manually. Even when I do that, I don't see any messages I added during the custom method using enqueueMessage.
Is there any way to send the User direct feedback from the onBeforeOrderUpdate Method, so I can let them know immediately if the custom capture process has succeeded or failed?
-- Joomla version -- : 3.10.2
-- PHP version -- : 7.4.23
My latest custom PaymentPlugin uses onBeforeOrderUpdate to contact our gateway provider to capture funds (which were pre-authorized during the Order Creation) whenever the order is later changed from status 'created' to 'shipped' or 'confirmed'. This status change is executed from the Orders List Admin page, so the process is actually executed in a Modal Window. Because of this, the Order listing is not reloaded after the method is finished. To view the actual changes made while changing the status, I have to reload the page manually. Even when I do that, I don't see any messages I added during the custom method using enqueueMessage.
Is there any way to send the User direct feedback from the onBeforeOrderUpdate Method, so I can let them know immediately if the custom capture process has succeeded or failed?
Last edit: 5 years 3 days ago by icomex.
Please Log in or Create an account to join the conversation.
5 years 3 days ago #335868
by nicolas
Replied by nicolas on topic User Feedback from an Order Status Change?
Hi,
You're on the right track. The problem is that the messages you add from a popup with enqueueMessage is that it's the popup that is displaying the messages, but since HikaShop stops the processing in the popup to close it, you're not seeing them.
And even if you reload the page manually, that won't change.
What I would recommend is for you to like this:
That will halt the process in the popup and display your error message in the popup.
If the payment capture is successful, then I would recommend to have that code in onAfterOrderUpdate:
Doing it like that will prevent HikaShop from closing the popup and will display the message through HikaShop's message display system which works even when the process of the page is stopped, which joomla's doesn't.
You're on the right track. The problem is that the messages you add from a popup with enqueueMessage is that it's the popup that is displaying the messages, but since HikaShop stops the processing in the popup to close it, you're not seeing them.
And even if you reload the page manually, that won't change.
What I would recommend is for you to like this:
Code:
if($_REQUEST['tmpl']=='component') {
echo hikashop_display('My error message', 'error');
exit;
}
If the payment capture is successful, then I would recommend to have that code in onAfterOrderUpdate:
Code:
if($_REQUEST['tmpl']=='component' && $this->payment_success) {
echo hikashop_display('My success message', 'success');
exit;
}
The following user(s) said Thank You: icomex
Please Log in or Create an account to join the conversation.
5 years 1 day ago #335906
by icomex
Replied by icomex on topic User Feedback from an Order Status Change?
I'll give it a shot. Thanks!
Please Log in or Create an account to join the conversation.
Time to create page: 0.181 seconds