Jump to content

Error when order state change


Blahout

Recommended Posts

Hello there,

 

I've just quick question. When I'm trying to change oldest orders state to canceled I get that error:

 

[PrestaShopException]

Property Order->module is not valid
at line 909 in file classes/ObjectModel.php

904. }
905.
906. $message = $this->validateField($field, $this->$field);
907. if ($message !== true) {
908. if ($die) {
909. throw new PrestaShopException($message);
910. }
911. return $error_return ? $message : false;
912. }
913. }
914.

 

Please, could you be so kind and help me? I run Presta on 1.6.1.4

Link to comment
Share on other sites

  • 5 months later...
  • 3 weeks later...

Which solution do you use ?

private function changeOrderState($order) {
        $order_state = new OrderState(6);

        $history = new OrderHistory();
        $history->id_order = $order->id;
        $history->id_employee = (int) $this->context->employee->id;

        $use_existings_payment = false;
        if (!$order->hasInvoice()) {
            $use_existings_payment = true;
        }

        $history->changeIdOrderState((int) $order_state->id, $order, $use_existings_payment);
    }
$order->setCurrentState(Configuration::get('PS_OS_CANCELED'), $this->context->employee->id);
Link to comment
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...