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

#   How to change order status from PHP?

##

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

Less More

- Posts: 13
- Thank you received: 2
-
-

9 years 8 months ago [\#264173](#264173) by [danidek](/forum/user/47455-danidek "View danidek's Profile")  *[How to change order status from PHP?](/forum/30-integrations/889197-how-to-change-order-status-from-php#264173 "Hi,  I have to integrate a bank transfer payment app. It handles all invoicing and payment according to local law, what is not easy other way. When all finished, it calls a php on my site where I want to change the order status to &quot;confirmed&quot; from php. I know the order ID, but I did not find and doc what functions can I call to change the status of order. I need to trigger the user notification email as well.  Thank you for your help!")* was created by *[danidek](/forum/user/47455-danidek "View danidek's Profile")*

Hi,

I have to integrate a bank transfer payment app. It handles all invoicing and payment according to local law, what is not easy other way.
When all finished, it calls a php on my site where **I want to change the order status to "confirmed" from php**.
I know the order ID, but I did not find and doc what functions can I call to change the status of order.
I need to trigger the user notification email as well.

Thank you for your help!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84ODkxOTctaG93LXRvLWNoYW5nZS1vcmRlci1zdGF0dXMtZnJvbS1waHA/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: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 8 months ago [\#264176](#264176) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[How to change order status from PHP?](/forum/30-integrations/889197-how-to-change-order-status-from-php#264176 "Hi,  I have to integrate a bank transfer payment app. It handles all invoicing and payment according to local law, what is not easy other way. When all finished, it calls a php on my site where I want to change the order status to &quot;confirmed&quot; from php. I know the order ID, but I did not find and doc what functions can I call to change the status of order. I need to trigger the user notification email as well.  Thank you for your help!")*

Hi,
Code:

$order = new stdClass(); $order-&gt;order_id = $order_id; // Information needed $order-&gt;order_status = 'confirmed'; $hikashopHelper = rtrim(JPATH_ADMINISTRATOR,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_hikashop'.DIRECTORY_SEPARATOR.'helpers'.DIRECTORY_SEPARATOR.'helper.php'; if(file_exists($hikashopHelper) &amp;&amp; include_once($hikashopHelper)) { $orderClass = hikashop_get('class.order'); $orderClass-&gt;save($order); }

Regards,

---

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

The following user(s) said Thank You: [danidek](/forum/user/47455-danidek "View danidek's Profile")

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

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

Less More

- Posts: 13
- Thank you received: 2
-
-

9 years 8 months ago [\#264247](#264247) by [danidek](/forum/user/47455-danidek "View danidek's Profile")  Replied by *[danidek](/forum/user/47455-danidek "View danidek's Profile")* on topic *[How to change order status from PHP?](/forum/30-integrations/889197-how-to-change-order-status-from-php#264247 "Hi,  I have to integrate a bank transfer payment app. It handles all invoicing and payment according to local law, what is not easy other way. When all finished, it calls a php on my site where I want to change the order status to &quot;confirmed&quot; from php. I know the order ID, but I did not find and doc what functions can I call to change the status of order. I need to trigger the user notification email as well.  Thank you for your help!")*

Thank you!. I've added a joomla login script before to get authenticated and it changes the status well. I've used Virtuemart before, but with Hikashop it takes 20 minutes what I did in Virtuemart in 2 days...

Can you help me in the notification of the user as well? The email was not sent.

The following user(s) said Thank You: [Jerome](/forum/user/80-jerome "View Jerome's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84ODkxOTctaG93LXRvLWNoYW5nZS1vcmRlci1zdGF0dXMtZnJvbS1waHA/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: 86587
- Thank you received: 14325
-
-

9 years 8 months ago [\#264297](#264297) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to change order status from PHP?](/forum/30-integrations/889197-how-to-change-order-status-from-php#264297 "Hi,  I have to integrate a bank transfer payment app. It handles all invoicing and payment according to local law, what is not easy other way. When all finished, it calls a php on my site where I want to change the order status to &quot;confirmed&quot; from php. I know the order ID, but I did not find and doc what functions can I call to change the status of order. I need to trigger the user notification email as well.  Thank you for your help!")*

Hi,

You can add such line before the save: Code:

$order-&gt;history-&gt;history_notified = 1;

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

- **[ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")**
- [![ler@singmuiheng.com's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")
- [ Offline](/forum/user/3330-ler-singmuiheng-com)

Less More

- Posts: 575
- Thank you received: 11
-
-

9 years 4 months ago [\#274735](#274735) by [ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")  Replied by *[ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")* on topic *[How to change order status from PHP?](/forum/30-integrations/889197-how-to-change-order-status-from-php#274735 "Hi,  I have to integrate a bank transfer payment app. It handles all invoicing and payment according to local law, what is not easy other way. When all finished, it calls a php on my site where I want to change the order status to &quot;confirmed&quot; from php. I know the order ID, but I did not find and doc what functions can I call to change the status of order. I need to trigger the user notification email as well.  Thank you for your help!")*

What about to set the remark beside the status changed message?

Is it $order-&gt;history-&gt;mymessage ?

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

- **[ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")**
- [![ler@singmuiheng.com's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")
- [ Offline](/forum/user/3330-ler-singmuiheng-com)

Less More

- Posts: 575
- Thank you received: 11
-
-

9 years 4 months ago [\#274801](#274801) by [ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")  Replied by *[ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")* on topic *[How to change order status from PHP?](/forum/30-integrations/889197-how-to-change-order-status-from-php#274801 "Hi,  I have to integrate a bank transfer payment app. It handles all invoicing and payment according to local law, what is not easy other way. When all finished, it calls a php on my site where I want to change the order status to &quot;confirmed&quot; from php. I know the order ID, but I did not find and doc what functions can I call to change the status of order. I need to trigger the user notification email as well.  Thank you for your help!")*

We noticed one thg when using $orderClass-&gt;save($order);

the invoice number was not generated.....did we miss out something?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84ODkxOTctaG93LXRvLWNoYW5nZS1vcmRlci1zdGF0dXMtZnJvbS1waHA/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: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 4 months ago -  9 years 4 months ago [\#274739](#274739) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[How to change order status from PHP?](/forum/30-integrations/889197-how-to-change-order-status-from-php#274739 "Hi,  I have to integrate a bank transfer payment app. It handles all invoicing and payment according to local law, what is not easy other way. When all finished, it calls a php on my site where I want to change the order status to &quot;confirmed&quot; from php. I know the order ID, but I did not find and doc what functions can I call to change the status of order. I need to trigger the user notification email as well.  Thank you for your help!")*

Hello
Code:

$order-&gt;history-&gt;history_data

Don't hesitate to take a look at the HikaShop code and plugins code in order to see how they are dealing with order status modification.
You can find for example a lot of useful code in the HikaShop helper core file ; in the hikashopPaymentPlugin class definition.

The invoice number is only generated by the save function when the status of the order changes from the created order status to one of the invoice order statuses as you can configure in the menu System&gt;Order statuses. So you might actually have an issue with your order statuses, or you didn't set an invoice status in the order_status attribute of your $order object.

Regards,

---

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

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

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

- **[ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")**
- [![ler@singmuiheng.com's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")
- [ Offline](/forum/user/3330-ler-singmuiheng-com)

Less More

- Posts: 575
- Thank you received: 11
-
-

9 years 3 months ago [\#275010](#275010) by [ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")  Replied by *[ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")* on topic *[How to change order status from PHP?](/forum/30-integrations/889197-how-to-change-order-status-from-php#275010 "Hi,  I have to integrate a bank transfer payment app. It handles all invoicing and payment according to local law, what is not easy other way. When all finished, it calls a php on my site where I want to change the order status to &quot;confirmed&quot; from php. I know the order ID, but I did not find and doc what functions can I call to change the status of order. I need to trigger the user notification email as well.  Thank you for your help!")*

Dear Jerome

We are unable to find "invoice order statuses as you can configure in the menu System&gt;Order statuses" since version 3.1.1 , can you advise?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84ODkxOTctaG93LXRvLWNoYW5nZS1vcmRlci1zdGF0dXMtZnJvbS1waHA/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: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 3 months ago [\#275025](#275025) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[How to change order status from PHP?](/forum/30-integrations/889197-how-to-change-order-status-from-php#275025 "Hi,  I have to integrate a bank transfer payment app. It handles all invoicing and payment according to local law, what is not easy other way. When all finished, it calls a php on my site where I want to change the order status to &quot;confirmed&quot; from php. I know the order ID, but I did not find and doc what functions can I call to change the status of order. I need to trigger the user notification email as well.  Thank you for your help!")*

Hello,

I'm sorry but I cannot ; There is the "invoice" column in the order statuses listing so I don't understand your message.

Regards,

---

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

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

- **[ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")**
- [![ler@singmuiheng.com's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")
- [ Offline](/forum/user/3330-ler-singmuiheng-com)

Less More

- Posts: 575
- Thank you received: 11
-
-

9 years 3 months ago [\#276803](#276803) by [ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")  Replied by *[ler@singmuiheng.com](/forum/user/3330-ler-singmuiheng-com "View ler@singmuiheng.com's Profile")* on topic *[How to change order status from PHP?](/forum/30-integrations/889197-how-to-change-order-status-from-php#276803 "Hi,  I have to integrate a bank transfer payment app. It handles all invoicing and payment according to local law, what is not easy other way. When all finished, it calls a php on my site where I want to change the order status to &quot;confirmed&quot; from php. I know the order ID, but I did not find and doc what functions can I call to change the status of order. I need to trigger the user notification email as well.  Thank you for your help!")*

> Jerome wrote: Hello
>
> Code:
>
> $order-&gt;history-&gt;history_data
>
>
>
> Don't hesitate to take a look at the HikaShop code and plugins code in order to see how they are dealing with order status modification.
> You can find for example a lot of useful code in the HikaShop helper core file ; in the hikashopPaymentPlugin class definition.
>
> The invoice number is only generated by the save function when the status of the order changes from the created order status to one of the **invoice order statuses as you can configure in the menu System&gt;Order statuses**. So you might actually have an issue with your order statuses, or you didn't set an invoice status in the order\_status attribute of your $order object.
>
> Regards,

we are unable to find as you mentioned since version 3.1

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84ODkxOTctaG93LXRvLWNoYW5nZS1vcmRlci1zdGF0dXMtZnJvbS1waHA/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: 86587
- Thank you received: 14325
-
-

9 years 3 months ago [\#276821](#276821) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to change order status from PHP?](/forum/30-integrations/889197-how-to-change-order-status-from-php#276821 "Hi,  I have to integrate a bank transfer payment app. It handles all invoicing and payment according to local law, what is not easy other way. When all finished, it calls a php on my site where I want to change the order status to &quot;confirmed&quot; from php. I know the order ID, but I did not find and doc what functions can I call to change the status of order. I need to trigger the user notification email as well.  Thank you for your help!")*

Hi,

Kind you provide a screenshot of what you're looking at ?

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

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