[Skip to main content](#vessel-content)

#   onAfterOrderUpdate is not being triggered

##

- **[ajdev33](/forum/user/59738-ajdev33 "View ajdev33's Profile")**
- [![ajdev33's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/59738-ajdev33 "View ajdev33's Profile") Topic Author
- [ Offline](/forum/user/59738-ajdev33)

Less More

- Posts: 21
- Thank you received: 0
-
-

6 years 3 months ago [\#322881](#322881) by [ajdev33](/forum/user/59738-ajdev33 "View ajdev33's Profile")  *[onAfterOrderUpdate is not being triggered](/forum/29-payment-methods/900575-onafterorderupdate-is-not-being-triggered#322881 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.19 -- PHP version -- : 7.3  Hello,  I am facing an issue in my custom payment plugin. When I my order status changes programatically then no code is being executed written in onAfterOrderUpdate method.  However I am able to trigger this from back-end but it is not working from front-end.  Please let me know if I am missing anything.  Thanks")* was created by *[ajdev33](/forum/user/59738-ajdev33 "View ajdev33's Profile")*

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.19
-- PHP version -- : 7.3

Hello,

I am facing an issue in my custom payment plugin. When I my order status changes programatically then no code is being executed written in onAfterOrderUpdate method.

However I am able to trigger this from back-end but it is not working from front-end.
Code:

public function onAfterOrderUpdate(&amp;$order) { if($order-&gt;old-&gt;order_status == 'created' &amp;&amp; $order-&gt;order_status == 'cancelled') { echo "test"; die; } }

Please let me know if I am missing anything.

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI5LXBheW1lbnQtbWV0aG9kcy85MDA1NzUtb25hZnRlcm9yZGVydXBkYXRlLWlzLW5vdC1iZWluZy10cmlnZ2VyZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

6 years 3 months ago -  6 years 3 months ago [\#322886](#322886) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[onAfterOrderUpdate is not being triggered](/forum/29-payment-methods/900575-onafterorderupdate-is-not-being-triggered#322886 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.19 -- PHP version -- : 7.3  Hello,  I am facing an issue in my custom payment plugin. When I my order status changes programatically then no code is being executed written in onAfterOrderUpdate method.  However I am able to trigger this from back-end but it is not working from front-end.  Please let me know if I am missing anything.  Thanks")*

Hi,

What do you mean by "When I my order status changes programatically then no code is being executed" ?
What is done to change the order status from created to cancelled on your website ? Do you open a specific URL ?
For example, if the order status is changed during a payment notification, this is usually done with a server to server connection between the payment gateway and your website directly. And thus, if there is a "echo 'test';die;" happening, it will be the server of the payment gateway which will get back a white page with the text "test", not the customer. So you, as a customer won't see anything different whether that code is executed or not.
A better way to check if and when you go into that if is to write something to a file.
That's what we usually do with payment plugins by doing something like that:
hikashop_writeToLog('test');
That hikashop_writeToLog function can be called from anywhere on your website once HikaShop's core is loaded, and it will log in the text in the "payment log file" you can see in the Files section of the HikaShop configuration page.

Last edit: 6 years 3 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI5LXBheW1lbnQtbWV0aG9kcy85MDA1NzUtb25hZnRlcm9yZGVydXBkYXRlLWlzLW5vdC1iZWluZy10cmlnZ2VyZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[ajdev33](/forum/user/59738-ajdev33 "View ajdev33's Profile")**
- [![ajdev33's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/59738-ajdev33 "View ajdev33's Profile") Topic Author
- [ Offline](/forum/user/59738-ajdev33)

Less More

- Posts: 21
- Thank you received: 0
-
-

6 years 3 months ago [\#322896](#322896) by [ajdev33](/forum/user/59738-ajdev33 "View ajdev33's Profile")  Replied by *[ajdev33](/forum/user/59738-ajdev33 "View ajdev33's Profile")* on topic *[onAfterOrderUpdate is not being triggered](/forum/29-payment-methods/900575-onafterorderupdate-is-not-being-triggered#322896 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.19 -- PHP version -- : 7.3  Hello,  I am facing an issue in my custom payment plugin. When I my order status changes programatically then no code is being executed written in onAfterOrderUpdate method.  However I am able to trigger this from back-end but it is not working from front-end.  Please let me know if I am missing anything.  Thanks")*

Yes, I tried writing file but nothing is being executed under this function from frontend.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI5LXBheW1lbnQtbWV0aG9kcy85MDA1NzUtb25hZnRlcm9yZGVydXBkYXRlLWlzLW5vdC1iZWluZy10cmlnZ2VyZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

6 years 3 months ago [\#322900](#322900) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[onAfterOrderUpdate is not being triggered](/forum/29-payment-methods/900575-onafterorderupdate-is-not-being-triggered#322900 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.19 -- PHP version -- : 7.3  Hello,  I am facing an issue in my custom payment plugin. When I my order status changes programatically then no code is being executed written in onAfterOrderUpdate method.  However I am able to trigger this from back-end but it is not working from front-end.  Please let me know if I am missing anything.  Thanks")*

Hello,

Can you give us more information about what do you mean by "When I my order status changes programatically then no code is being executed" ?
Also, Can you tell us what you exactly want to achieve so that we can properly advise you ? Thank you

Kind regards,
Mohamed.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI5LXBheW1lbnQtbWV0aG9kcy85MDA1NzUtb25hZnRlcm9yZGVydXBkYXRlLWlzLW5vdC1iZWluZy10cmlnZ2VyZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.052 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
