Search code examples
opencartopencart2.x

Where is the admin-sales-orders > modify Order Status code of model file?


I am trying to find the model file function which updates the order status from admin dashboard. I checked all the functions of /admin/model/sale/order.php file but no use. Any help would be appreciated. My store opencart Version is 2.3.0.2


Solution

  • In OC 2.3 the admin order info screen (which is where you'd typically be performing status updates) makes an ajax call to the front end api method history() in catalog/controller/api/order.php when you change status.

    This in turn calls addOrderHistory() in catalog/model/checkout/order.php to update the status. If you want to modify the logic you could do it in either place, depending on your needs.

    The important point here is that in this version most of the order related admin functions work through the front end api to modify orders. This has been the case beginning with OC version 2.0 and remains this way in Opencart 3.