[-] Classes : fixed bug #PSCFV-2681 - issue with updating of current_state column on order table
This commit is contained in:
@@ -781,8 +781,7 @@ class OrderCore extends ObjectModel
|
||||
$order_state = $this->getCurrentOrderState();
|
||||
if ($order_state && $order_state->paid && $order_state->shipped)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -290,6 +290,7 @@ class OrderHistoryCore extends ObjectModel
|
||||
$context = Context::getContext();
|
||||
$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'));
|
||||
|
||||
if (!parent::add($autodate))
|
||||
return false;
|
||||
@@ -314,11 +315,6 @@ class OrderHistoryCore extends ObjectModel
|
||||
// An additional email is sent the first time a virtual item is validated
|
||||
$virtual_products = $order->getVirtualProducts();
|
||||
|
||||
$new_order_state = new OrderState($this->id_order_state, Configuration::get('PS_LANG_DEFAULT'));
|
||||
// Update id_order_state attribute in Order
|
||||
$order->current_state = $new_order_state->id;
|
||||
$order->update();
|
||||
|
||||
if ($virtual_products && (!$last_order_state || !$last_order_state->logable) && $new_order_state && $new_order_state->logable)
|
||||
{
|
||||
$assign = array();
|
||||
@@ -355,6 +351,10 @@ class OrderHistoryCore extends ObjectModel
|
||||
Mail::Send((int)$order->id_lang, $result['template'], $topic, $data, $result['email'], $result['firstname'].' '.$result['lastname']);
|
||||
}
|
||||
|
||||
// Update id_order_state attribute in Order
|
||||
$order->current_state = $new_order_state->id;
|
||||
$order->update();
|
||||
|
||||
Hook::exec('actionOrderHistoryAddAfter', array('order_history' => $this));
|
||||
|
||||
return true;
|
||||
|
||||
@@ -413,4 +413,4 @@
|
||||
</form>
|
||||
{else}
|
||||
<p><img src="{$img_dir}icon/infos.gif" alt="" class="icon" /> {l s='You cannot make a merchandise return with a guest account'}</p>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user