Skip to content
Code-Schnipsel Gruppen Projekte
Commit d7a05e0c erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

Merge branch 'main' into 'next-3.x'

Update 'next-3.x' with latest changes from 'main'

See merge request !36
Übergeordnete 3d423e87 5be6d037
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
1 Merge Request!36Update 'next-3.x' with latest changes from 'main'
Pipeline-Nr. 16502 bestanden
......@@ -139,6 +139,8 @@ public static function onOrderProcessGetOrder($OrderProcess): ?AbstractOrder
isset($_REQUEST['step']) && $_REQUEST['step'] === 'Processing'
|| $OrderProcess->getAttribute('step') === 'Processing'
) {
$email = QUI::getSession()->get(GuestOrder::EMAIL);
$result = QUI::getDataBase()->fetch([
'from' => $Handler->table(),
'where' => [
......@@ -152,7 +154,6 @@ public static function onOrderProcessGetOrder($OrderProcess): ?AbstractOrder
if (isset($result[0])) {
$customer = $result[0]['customer'];
$customer = json_decode($customer, true);
$email = QUI::getSession()->get(GuestOrder::EMAIL);
if ($customer['email'] === $email) {
if (isset($customer['uuid'])) {
......@@ -168,6 +169,32 @@ public static function onOrderProcessGetOrder($OrderProcess): ?AbstractOrder
} catch (\Exception) {
}
}
} else {
// order is already in process status
// maybe payment error or async payment with error
// we have to get the current order via the url hash
// problem is, it could be an OrderInProcess or already an Order
if (isset($_REQUEST['orderHash'])) {
try {
$Order = $Handler->getOrderByHash($_REQUEST['orderHash']);
$Customer = $Order->getCustomer();
$Address = $Customer->getStandardAddress();
$mailList = $Address->getMailList();
$customerMail = null;
if (!empty($mailList)) {
$customerMail = $mailList[0];
}
if ($customerMail === $email) {
QUI::getSession()->set(GuestOrder::CUSTOMER_UUID, $Customer->getUUID());
QUI::getSession()->set(GuestOrder::CUSTOMER_ID, $Customer->getId());
return $Order;
}
} catch (\Exception) {
}
}
}
}
......@@ -210,6 +237,17 @@ public static function onOrderProcessGetOrder($OrderProcess): ?AbstractOrder
}
try {
// maybe we have to set the customer uuid
// only if session exists
if (QUI::getSession()->get(GuestOrder::CUSTOMER_UUID)) {
// cUser ändern
QUI::getDataBase()->update(
$Handler->tableOrderProcess(),
['c_user' => QUI::getSession()->get(GuestOrder::CUSTOMER_UUID)],
['id' => $orderId]
);
}
return $Handler->getOrderInProcess($orderId);
} catch (\Exception) {
return null;
......
......@@ -40,7 +40,7 @@ public function getId(): int
return 6;
}
public function getUUID(): string|int
public function getUUID(): string | int
{
if (!QUI::getSession()->get(GuestOrder::CUSTOMER_UUID)) {
QUI::getSession()->set(
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren