Jump to content

Prestashop 1.6.1.14 - Update Status by Module


Go to solution Solved by Enthu86,

Recommended Posts

I am creating a module with the a form on .tpl. I have created a function as follow to update the status but I am receiving an error:

Property OrderHistory->id_order_state is empty
at line 909 in file classes/ObjectModel.php

public function postProcess()
{
global $cookie;

if (Tools::isSubmit('submitpaymentvalidated')) {
$ids= Tools::getValue('paymentvalidated');

foreach ($ids as $updateids) {
$objOrder = new Order($updateids);
$history = new OrderHistory();
$history->id_order = (int)$objOrder->id;
$history->id_employee = $cookie->id_employee;
$history->changeIdOrderState(3, (int)($objOrder->id));
$history->add(true);
$history->save();
   }
  }
}

I am baffled as to why the error occured when I am using changeIdOrderState.

Any guidance is truly appreciated.

Thank you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More