joseantgv Posted February 25, 2013 Share Posted February 25, 2013 Hello, I am working with ps 1.5.3.1 and I am experiencing probelms with the function behaviour of addWithemail from OrderHistory class. At first of this function sets 2 variables, $last_order_state and $new_order_state: $order = new Order($this->id_order); $last_order_state = $order->getCurrentOrderState(); $new_order_state = new OrderState($this->id_order_state, Configuration::get('PS_LANG_DEFAULT')); As far as I know, this function is called in PaymentModule controller after changing its status: $new_history->changeIdOrderState((int)$id_order_state, $order, true); $new_history->addWithemail(true, $extra_vars); So this makes that $last_order_state and $new_order_state is always the same status, and the problem I have is that this comparison: if ($virtual_products && (!$last_order_state || !$last_order_state->logable) && $new_order_state && $new_order_state->logable) is never true because $last_order_state should not be logable, as it is $new_order_state. Am I right? Do I make any wrong assumption? Thank you. Link to comment Share on other sites More sharing options...
joseantgv Posted February 25, 2013 Author Share Posted February 25, 2013 Sorry, I was working with and override function. In 1.5.3.1 AddWithEmail function is: if ($virtual_products && (!$last_order_state || !$last_order_state->logable || ($last_order_state->id == $new_order_state->id)) && $new_order_state && $new_order_state->logable) Link to comment Share on other sites More sharing options...
Recommended Posts