From e3ae806400170f7a5352a139f41aeb5655c7c1a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Thu, 5 Dec 2024 19:36:45 +0100 Subject: [PATCH] OX6-164 - Fixed saveAfterRedirect function --- extend/application/models/fcPayOneOrder.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extend/application/models/fcPayOneOrder.php b/extend/application/models/fcPayOneOrder.php index 56b5e58..81ec7e8 100755 --- a/extend/application/models/fcPayOneOrder.php +++ b/extend/application/models/fcPayOneOrder.php @@ -493,8 +493,6 @@ protected function _fcpoFinalizeOrder($oBasket, $oUser, $blRecalculatingOrder) { $this->_blFinishingSave = true; $this->save(); - $this->_fcpoSaveAfterRedirect($blSaveAfterRedirect); - // deleting remark info only when order is finished $this->_oFcpoHelper->fcpoDeleteSessionVariable('ordrem'); $this->_oFcpoHelper->fcpoDeleteSessionVariable('stsprotection'); @@ -526,6 +524,8 @@ protected function _fcpoFinalizeOrder($oBasket, $oUser, $blRecalculatingOrder) { oxNew(\OxidEsales\Eshop\Core\Counter::class)->update($this->_getCounterIdent(), $this->oxorder__oxordernr->value); } + $this->_fcpoSaveAfterRedirect($blSaveAfterRedirect); + $this->_oFcpoHelper->fcpoDeleteSessionVariable('fcpoordernotchecked'); $this->_oFcpoHelper->fcpoDeleteSessionVariable('fcpoWorkorderId'); @@ -960,10 +960,10 @@ protected function _fcpoFinishOrder($blRecalculatingOrder, $oUser, $oBasket, $oU * @param bool $blSaveAfterRedirect * @return void */ - protected function _fcpoSaveAfterRedirect($blSaveAfterRedirect) + protected function _fcpoSaveAfterRedirect($blSaveAfterRedirect) { - if ($blSaveAfterRedirect === true) { - $sQuery = "UPDATE fcpotransactionstatus SET fcpo_ordernr = '{$this->oxorder__oxordernr->value}' WHERE fcpo_txid = '" . $this->_oFcpoHelper->fcpoGetSessionVariable('fcpoTxid') . "'"; + if ($blSaveAfterRedirect === true && !empty($this->oxorder__fcpotxid->value)) { + $sQuery = "UPDATE fcpotransactionstatus SET fcpo_ordernr = '{$this->oxorder__oxordernr->value}' WHERE fcpo_txid = '".$this->oxorder__fcpotxid->value."'"; $this->_oFcpoDb->Execute($sQuery); } }