Fixed: Error on order confirmation page when order status is updated

This commit is contained in:
Shreesh Arora
2024-05-28 17:46:01 +05:30
parent 19c4e45320
commit fbcf1ab19d
2 changed files with 17 additions and 13 deletions

View File

@@ -208,14 +208,16 @@ class Bankwire extends PaymentModule
}
$objOrder = $params['objOrder'];
$orderState = $objOrder->getCurrentState();
$idOrderState = $objOrder->getCurrentState();
$objOrderState = new OrderState($idOrderState);
$history = $objOrder->getHistory($this->context->language->id);
$initialStatus = array_pop($history);
$smartyVars = array();
if (in_array(
$orderState,
array(
Configuration::get('PS_OS_AWAITING_PAYMENT'),
if ($idOrderState == Configuration::get('PS_OS_AWAITING_PAYMENT')
|| ($objOrderState->logable
&& $initialStatus['id_order_state'] == Configuration::get('PS_OS_AWAITING_PAYMENT')
)
)) {
) {
$objCart = new Cart($objOrder->id_cart);
if ($objCart->is_advance_payment) {
$cartTotal = $objOrder->getOrdersTotalPaid(1);

View File

@@ -191,13 +191,15 @@ class Cheque extends PaymentModule
return;
}
$objOrder = $params['objOrder'];
$orderState = $objOrder->getCurrentState();
if (in_array(
$orderState,
array(
Configuration::get('PS_OS_AWAITING_PAYMENT')
)
)) {
$idOrderState = $objOrder->getCurrentState();
$objOrderState = new OrderState($idOrderState);
$history = $objOrder->getHistory($this->context->language->id);
$initialStatus = array_pop($history);
if ($idOrderState == Configuration::get('PS_OS_AWAITING_PAYMENT')
|| ($objOrderState->logable
&& $initialStatus['id_order_state'] == Configuration::get('PS_OS_AWAITING_PAYMENT')
)
) {
$objCart = new Cart($objOrder->id_cart);
if ($objCart->is_advance_payment) {
$cartTotal = $objOrder->getOrdersTotalPaid(1);