summaryrefslogtreecommitdiff
path: root/views/mods/mod_revocation/ajaxDialogContent.phtml
diff options
context:
space:
mode:
Diffstat (limited to 'views/mods/mod_revocation/ajaxDialogContent.phtml')
-rw-r--r--views/mods/mod_revocation/ajaxDialogContent.phtml21
1 files changed, 8 insertions, 13 deletions
diff --git a/views/mods/mod_revocation/ajaxDialogContent.phtml b/views/mods/mod_revocation/ajaxDialogContent.phtml
index fd160f0..163d004 100644
--- a/views/mods/mod_revocation/ajaxDialogContent.phtml
+++ b/views/mods/mod_revocation/ajaxDialogContent.phtml
@@ -18,7 +18,8 @@
$arReason = \wpsgRevocation\Revocation::getReasons();
// Produkte
- $dialog_config = json_decode((wp_kses_stripslashes($_REQUEST['dialog_config']??'[]')), true);
+ $dialog_config = json_decode((wp_kses_stripslashes((string)($_REQUEST['dialog_config']??'[]'))), true);
+ if (!is_array($dialog_config)) $dialog_config = [];
$contact_email = "";
@@ -38,20 +39,14 @@ $arReason = \wpsgRevocation\Revocation::getReasons();
<div id="msg_target"></div>
- <?php if (sizeof($dialog_config['arOrderProductID']) > 0) { ?>
+ <?php /* Nur eigene Bestellungen des angemeldeten Kunden (Revocation::dialogRows) */ $arRows = Revocation::dialogRows((is_array($dialog_config)?($dialog_config['arOrderProductID']??null):null), $customer_login_id); ?>
+ <?php if (sizeof($arRows) > 0) { ?>
- <?php foreach ($dialog_config['arOrderProductID'] as $row) {
+ <?php foreach ($arRows as $key => $row) {
- $order_id = intval($row['order_id']);
- $order_product_id = intval($row['order_product_id']);
- $amount = intval($row['amount']);
-
- $oOrder = \wpsg_order::getInstance($order_id);
- $oOrderProduct = \wpsg_order_product::getInstance($order_product_id);
-
- if (!$oOrder->isLoaded() || !$oOrderProduct->isLoaded()) continue;
-
- $key = $order_id.'_'.$order_product_id;
+ $oOrder = $row['oOrder'];
+ $oOrderProduct = $row['oOrderProduct'];
+ $amount = $row['amount'];
$id = 'wpsg_rvd_'.$key; // eindeutige ids für die Beschriftungen (W5)
?>