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

#   modifyOrder method not updating order's status !

##

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

Less More

- Posts: 4
- Thank you received: 0
-
-

9 years 4 months ago [\#272088](#272088) by [wbobteng](/forum/user/34814-wbobteng "View wbobteng's Profile")  *[modifyOrder method not updating order's status !](/forum/31-development/890754-modifyorder-method-not-updating-orders-status#272088 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.19  Hello,  First of all thanks to the developers for great e-commerce extension. I am working for a payment plugin &amp; have taken alipay as sample of my work. The plugin is working fine but after getting notification from payment server I tried to use modifyOrder() method to update the order status but it's not working.  I am doing like:  But the above code not updating the order's status. I checked that $order&#95;id is OK, $this-&gt;payment&#95;params &amp; $this-&gt;getOrder($order&#95;id) has the data too. I tried to do update the status of the order manually like this:  But I can't understand why modifyOrder() method not working. I can change the status manually but it won't send confirmation emails &amp; will avoid running other important triggers. Any suggestion please?  Thanks")* was created by *[wbobteng](/forum/user/34814-wbobteng "View wbobteng's Profile")*

-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.2
-- PHP version -- : 7.0.19

Hello,

First of all thanks to the developers for great e-commerce extension. I am working for a payment plugin &amp; have taken alipay as sample of my work. The plugin is working fine but after getting notification from payment server I tried to use modifyOrder() method to update the order status but it's not working.

I am doing like:
Code:

$history = new stdClass(); $price_check = round($dbOrder-&gt;order_full_price, (int)$this-&gt;currency-&gt;currency_locale['int_frac_digits'] ); $history-&gt;notified=1; $history-&gt;amount=$price_check; $history-&gt;data = ob_get_clean(); $order_status = $this-&gt;payment_params-&gt;verified_status; if($dbOrder-&gt;order_status == $order_status) return true; $this-&gt;modifyOrder($order_id,$order_status,$history,false);

But the above code not updating the order's status. I checked that $order_id is OK, $this-&gt;payment_params &amp; $this-&gt;getOrder($order_id) has the data too. I tried to do update the status of the order manually like this:
Code:

$db = JFactory::getDbo(); $query = $db-&gt;getQuery(true); $fields = array($db-&gt;quoteName('order_status') . ' = ' . $db-&gt;quote($order_status)); $conditions = array($db-&gt;quoteName('order_id') . ' = ' . $db-&gt;quote($order_id)); $query-&gt;update($db-&gt;quoteName('#__hikashop_order'))-&gt;set($fields)-&gt;where($conditions); $db-&gt;setQuery($query); $result = $db-&gt;execute();

But I can't understand why modifyOrder() method not working. I can change the status manually but it won't send confirmation emails &amp; will avoid running other important triggers. Any suggestion please?

Thanks

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

9 years 4 months ago [\#272131](#272131) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[modifyOrder method not updating order's status !](/forum/31-development/890754-modifyorder-method-not-updating-orders-status#272131 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.19  Hello,  First of all thanks to the developers for great e-commerce extension. I am working for a payment plugin &amp; have taken alipay as sample of my work. The plugin is working fine but after getting notification from payment server I tried to use modifyOrder() method to update the order status but it's not working.  I am doing like:  But the above code not updating the order's status. I checked that $order&#95;id is OK, $this-&gt;payment&#95;params &amp; $this-&gt;getOrder($order&#95;id) has the data too. I tried to do update the status of the order manually like this:  But I can't understand why modifyOrder() method not working. I can change the status manually but it won't send confirmation emails &amp; will avoid running other important triggers. Any suggestion please?  Thanks")*

Hello,

Depending the context, modifyOrder should receive the order ID or the order object.
By giving the order ID, the database is updated ; but if just after that, the order is modified by the HikaShop core ; for sure your modification will be overwrite.

Regards,

PS : Replying to your own message won't make our answer faster but it will have in fact the total opposite effect.
We reply to messages in order and we generally reply under 24 hours ; but we need to sleep and take some rest during the week end. Thank you for your understading.

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5MDc1NC1tb2RpZnlvcmRlci1tZXRob2Qtbm90LXVwZGF0aW5nLW9yZGVycy1zdGF0dXM/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.134 seconds

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

[](#top)
