diff options
| author | Roger Rehnelt <noreply@maennchen1.de> | 2026-10-03 15:38:49 +0200 |
|---|---|---|
| committer | Roger Rehnelt <noreply@maennchen1.de> | 2026-10-03 15:38:49 +0200 |
| commit | f786f0c59d9a95d6829aaf58d99c882a609355ed (patch) | |
| tree | 3b6e97793ed5c1eaffcc06dbecd94f62f55f8287 /views | |
| parent | 6b03b7e7a5b47b52ea5d5b6aae2efb945f4dd686 (diff) | |
Widerrufsformular: Bestätigung ohne Bestelldaten, Name und Schlüssel
Jeder Widerruf wird angenommen; die Eingangsbestätigung an die eingetragene Adresse enthält nur die eigenen Angaben, der Betreiber bekommt die Bestelldaten mit Vermerken. Neues Pflichtfeld Name; der Link aus der Bestellmail bestätigt den Widerruf.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'views')
| -rw-r--r-- | views/mods/mod_revocation/ajaxDialogContent.phtml | 12 | ||||
| -rwxr-xr-x | views/mods/mod_revocation/mail_row.phtml | 3 | ||||
| -rwxr-xr-x | views/mods/mod_revocation/mail_row_html.phtml | 5 | ||||
| -rw-r--r-- | views/mods/mod_revocation/mails/mail_admin_html.phtml | 83 | ||||
| -rw-r--r-- | views/mods/mod_revocation/mails/mail_admin_text.phtml | 66 | ||||
| -rw-r--r-- | views/mods/mod_revocation/mails/mail_customer_html.phtml | 86 | ||||
| -rw-r--r-- | views/mods/mod_revocation/mails/mail_customer_text.phtml | 53 | ||||
| -rw-r--r-- | views/mods/mod_revocation/order_view_row.phtml | 3 | ||||
| -rw-r--r-- | views/mods/mod_revocation/page_form.phtml | 14 | ||||
| -rw-r--r-- | views/mods/mod_revocation/wp_footer.phtml | 12 |
10 files changed, 154 insertions, 183 deletions
diff --git a/views/mods/mod_revocation/ajaxDialogContent.phtml b/views/mods/mod_revocation/ajaxDialogContent.phtml index 163d004..e10202c 100644 --- a/views/mods/mod_revocation/ajaxDialogContent.phtml +++ b/views/mods/mod_revocation/ajaxDialogContent.phtml @@ -22,6 +22,7 @@ $arReason = \wpsgRevocation\Revocation::getReasons(); if (!is_array($dialog_config)) $dialog_config = []; $contact_email = ""; + $contact_name = ""; $customer_login_id = intval(\wpsg_ShopController::getShop()->callMod('wpsg_mod_kundenverwaltung', 'isLoggedIn')); @@ -30,6 +31,7 @@ $arReason = \wpsgRevocation\Revocation::getReasons(); $oCustomer = \wpsg_customer::getInstance($customer_login_id); $contact_email = $oCustomer->getEmail(); + $contact_name = trim($oCustomer->getFirstname().' '.$oCustomer->getName()); } @@ -137,6 +139,16 @@ $arReason = \wpsgRevocation\Revocation::getReasons(); <?php } ?> <div class="form_field"> + <label class="label" for="wpsg_rvd_name"><?php echo __('Name', 'wpsg'); ?></label> + <div class="value"> + <input type="text" required id="wpsg_rvd_name" autocomplete="name" name="wpsg_revocation_reason[name]" value="<?php echo \esc_attr($contact_name); ?>" /> + </div> + </div> + + <?php /* Schlüssel aus dem Link der Bestellmail, füllt wp_footer.phtml aus wpsg_revo_key (S18) */ ?> + <input type="hidden" name="wpsg_revocation_reason[key]" value="" /> + + <div class="form_field"> <label class="label" for="wpsg_rvd_contact"><?php echo __('Kontakt - E-Mail', 'wpsg'); ?></label> <div class="value"> <input type="email" required id="wpsg_rvd_contact" autocomplete="email" name="wpsg_revocation_reason[contact]" value="<?php echo \esc_attr($contact_email); ?>" diff --git a/views/mods/mod_revocation/mail_row.phtml b/views/mods/mod_revocation/mail_row.phtml index e9db4e4..183d68b 100755 --- a/views/mods/mod_revocation/mail_row.phtml +++ b/views/mods/mod_revocation/mail_row.phtml @@ -11,7 +11,8 @@ $amount = $this->view['wpsg_mod_revocation']['amount']; $order_product_id = intval($this->view['wpsg_mod_revocation']['order_product_id']); - $revo_url = home_url('/').'?wpsg_revo_order='.urlencode($order_nr).'&wpsg_revo_product='.urlencode($product_nr).'&wpsg_revo_amount='.urlencode($amount); + // Schlüssel der Bestellung (S18): bestätigt den Widerruf; keine Nonce, siehe Revocation::orderToken() + $revo_url = home_url('/').'?wpsg_revo_order='.urlencode($order_nr).'&wpsg_revo_product='.urlencode($product_nr).'&wpsg_revo_amount='.urlencode($amount).'&wpsg_revo_key='.urlencode((string)($this->view['wpsg_mod_revocation']['key'] ?? '')); ?><?php echo "\n"; ?> <?php echo wpsg_pad_left(__('Vertrag widerrufen:', 'wpsg').' ', 15); ?> <?php echo $revo_url; ?> diff --git a/views/mods/mod_revocation/mail_row_html.phtml b/views/mods/mod_revocation/mail_row_html.phtml index 4628b9d..ae060c1 100755 --- a/views/mods/mod_revocation/mail_row_html.phtml +++ b/views/mods/mod_revocation/mail_row_html.phtml @@ -13,13 +13,14 @@ $amount = $this->view['wpsg_mod_revocation']['amount']; $order_product_id = intval($this->view['wpsg_mod_revocation']['order_product_id']); - $revo_url = home_url('/').'?wpsg_revo_order='.urlencode($order_nr).'&wpsg_revo_product='.urlencode($product_nr).'&wpsg_revo_amount='.urlencode($amount); + // Schlüssel der Bestellung (S18): bestätigt den Widerruf; keine Nonce, siehe Revocation::orderToken() + $revo_url = home_url('/').'?wpsg_revo_order='.urlencode($order_nr).'&wpsg_revo_product='.urlencode($product_nr).'&wpsg_revo_amount='.urlencode($amount).'&wpsg_revo_key='.urlencode((string)($this->view['wpsg_mod_revocation']['key'] ?? '')); ?> <tr class="productrow productrow2 <?php echo ((($i % 2) == 0)?'productrow_odd':'productrow_even'); ?>"> <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_pos"> </td> <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_name"><?php echo __('Widerruf', 'wpsg'); ?>:</td> <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_name" colspan="4"> - <a href="<?php echo $revo_url; ?>"><?php echo __('Vertrag widerrufen', 'wpsg'); ?></a> + <a href="<?php echo esc_url($revo_url); ?>"><?php echo __('Vertrag widerrufen', 'wpsg'); ?></a> </td> </tr> diff --git a/views/mods/mod_revocation/mails/mail_admin_html.phtml b/views/mods/mod_revocation/mails/mail_admin_html.phtml index 4ff7820..c819841 100644 --- a/views/mods/mod_revocation/mails/mail_admin_html.phtml +++ b/views/mods/mod_revocation/mails/mail_admin_html.phtml @@ -2,80 +2,45 @@ /** @version 4.6.1 */ declare(strict_types=1); - + /** - * @author: Daniel Schmitzer - * @date: 14.04.26 - * @time: 09:21 + * Mail an den Betreiber (HTML) * + * Mit Bestelldaten (Platzhalter nur bei genau einer gefundenen Bestellung), Bestätigung und Vermerken (S18). */ - + namespace wpsgRevocation; - + $arSubmitData = \wpsg_ShopController::getShop()->view['arSubmitData'] ?? []; - $arReason = Revocation::getReasons(); + $time = (string)($arSubmitData[0]['time'] ?? \current_time('mysql')); ?> <p><?php echo __('Hallo,', 'wpsg'); ?></p> -<p><?php echo __('ein Kunde hat einen Widerruf für ein Produkt durchgeführt.', 'wpsg'); ?></p> +<p><?php echo __('es ist eine Widerrufserklärung eingegangen.', 'wpsg'); ?></p> <p> - <strong><?php echo __('Name', 'wpsg'); ?>:</strong> %kunde_anrede% %kunde_vname% %kunde_name%<br> - <strong><?php echo __('E-Mail', 'wpsg'); ?>:</strong> %kunde_email% + <strong><?php echo __('Name (angegeben)', 'wpsg'); ?>:</strong> <?php echo \esc_html($arSubmitData[0]['name'] ?? ''); ?><br> + <strong><?php echo __('E-Mail (angegeben)', 'wpsg'); ?>:</strong> <?php echo \esc_html($arSubmitData[0]['contact'] ?? ''); ?><br> + <strong><?php echo __('Eingang', 'wpsg'); ?>:</strong> <?php echo \esc_html(\mysql2date('d.m.Y H:i:s', $time)); ?> </p> <hr> -<?php foreach ($arSubmitData as $key => $d): - - $oOrder = $d['oOrder']; - $oOrderProduct = $d['oOrderProduct']; - - $reasonText = array_values(array_filter( - $arReason, - function($item) use ($d) { - return $item['id'] === $d['reason']; - } - ))[0]['text'] ?? __('Kein Grund angegeben', 'wpsg'); -?> - - <div style="margin-bottom:15px; padding-bottom:10px; border-bottom:1px solid #ddd;"> - <p> - <strong><?php echo __('Bestellung', 'wpsg'); ?>:</strong> - <?php echo $oOrder->getNr(); ?> - </p> - - <p> - <strong><?php echo __('Produkt', 'wpsg'); ?>:</strong> - <?php echo $d['amount']; ?> x <?php echo $oOrderProduct->getProduct()->getProductName(true); ?> - / <?php echo __('Artikelnummer', 'wpsg'); ?>: - <?php echo $oOrderProduct->getProduct()->getNr(); ?> - </p> +<?php foreach ($arSubmitData as $d) { $oOrder = $d['oOrder']; $oOrderProduct = $d['oOrderProduct']; ?> +<div style="margin-bottom:15px; padding-bottom:10px; border-bottom:1px solid #ddd;"> + <p><strong><?php echo __('Bestellung', 'wpsg'); ?>:</strong> <?php echo \esc_html(($oOrder !== null)?(string)$oOrder->getNr():$d['order_nr']); ?></p> + <?php if ($oOrder !== null) { ?><p><strong><?php echo __('Besteller', 'wpsg'); ?>:</strong> <?php echo \esc_html((string)$oOrder->getCustomer()->getEMail()); ?></p><?php } ?> + <p><strong><?php echo __('Produkt', 'wpsg'); ?>:</strong> <?php echo intval($d['amount']); ?> x <?php echo \esc_html(($oOrderProduct !== null)?$oOrderProduct->getProduct()->getProductName(true).' / '.__('Artikelnummer', 'wpsg').': '.$oOrderProduct->getProduct()->getNr():$d['product_nr']); ?></p> + <p><strong><?php echo __('Bestätigt', 'wpsg'); ?>:</strong> <?php echo (($d['confirmed'])?__('ja (Link aus der Bestellmail oder angemeldeter Besteller)', 'wpsg'):__('nein', 'wpsg')); ?></p> + <p><strong><?php echo __('Ausgewählter Grund', 'wpsg'); ?>:</strong> <?php echo \esc_html(Revocation::reasonText((string)$d['reason'])); ?></p> + <p><strong><?php echo __('Bemerkung', 'wpsg'); ?>:</strong> <?php echo nl2br(\esc_html($d['comment'])); ?></p> + <?php foreach (Revocation::noteTexts($d['notes']) as $note) { ?><p><strong><?php echo __('Vermerk', 'wpsg'); ?>:</strong> <?php echo \esc_html($note); ?></p><?php } ?> +</div> +<?php } ?> - <p> - <strong><?php echo __('Ausgewählter Grund', 'wpsg'); ?>:</strong> - <?php echo $reasonText; ?> - </p> - - <p> - <strong><?php echo __('Bemerkung', 'wpsg'); ?>:</strong> - <?php echo nl2br(htmlspecialchars($d['comment'] ?? '')); ?> - </p> - </div> - -<?php endforeach; ?> +<p><?php echo __('Bitte prüft den Vorgang und führt die Rückabwicklung (Storno / Rückerstattung) durch.', 'wpsg'); ?></p> <p> - <strong><?php echo __('Datum des Widerrufs', 'wpsg'); ?>:</strong> - <?php echo date('d.m.Y H:i:s'); ?> + <?php echo __('Viele Grüße', 'wpsg'); ?><br> + <?php echo \esc_html(\wpsg_ShopController::getShop()->get_option('wpsg_shopdata_name')); ?> - <?php echo __('Team', 'wpsg'); ?> </p> - -<p> - <?php echo __('Bitte prüft den Vorgang und führt die Rückabwicklung (Storno / Rückerstattung) durch.', 'wpsg'); ?> -</p> - -<p> - <?php echo __('Viele Grüße', 'wpsg'); ?><br> - <?php echo \wpsg_ShopController::getShop()->get_option('wpsg_shopdata_name'); ?> - - <?php echo __('Team', 'wpsg'); ?> -</p>
\ No newline at end of file diff --git a/views/mods/mod_revocation/mails/mail_admin_text.phtml b/views/mods/mod_revocation/mails/mail_admin_text.phtml index c0e3342..4253b8d 100644 --- a/views/mods/mod_revocation/mails/mail_admin_text.phtml +++ b/views/mods/mod_revocation/mails/mail_admin_text.phtml @@ -1,45 +1,53 @@ <?php /** @version 4.6.1 */ - + declare(strict_types=1); - + /** - * @author: Daniel Schmitzer - * @date: 14.04.26 - * @time: 09:21 + * Mail an den Betreiber * + * Mit Bestelldaten (Platzhalter nur bei genau einer gefundenen Bestellung), Bestätigung und Vermerken (S18). */ - + namespace wpsgRevocation; - + $arSubmitData = \wpsg_ShopController::getShop()->view['arSubmitData'] ?? []; - $arReason = Revocation::getReasons(); + $time = (string)($arSubmitData[0]['time'] ?? \current_time('mysql')); + +?><?php echo __('Hallo,', 'wpsg'); ?> + + +<?php echo __('es ist eine Widerrufserklärung eingegangen.', 'wpsg'); ?> + + +<?php echo mb_str_pad(__('Name (angegeben)', 'wpsg').':', 25); ?> <?php echo ($arSubmitData[0]['name'] ?? ''); ?> + +<?php echo mb_str_pad(__('E-Mail (angegeben)', 'wpsg').':', 25); ?> <?php echo ($arSubmitData[0]['contact'] ?? ''); ?> -?><?php echo __('Hallo,', 'wpsg'); ?> - -<?php echo __('ein Kunde hat einen Widerruf für ein Produkt durchgeführt.', 'wpsg'); ?> - -<?php echo mb_str_pad(__('Name', 'wpsg').':', 25); ?> %kunde_anrede% %kunde_vname% %kunde_name% -<?php echo mb_str_pad(__('E-Mail', 'wpsg').':', 25); ?> %kunde_email% - -<?php foreach ($arSubmitData as $key => $d) { +<?php echo mb_str_pad(__('Eingang', 'wpsg').':', 25); ?> <?php echo \mysql2date('d.m.Y H:i:s', $time); ?> - /** @var \wpsg_order $oOrder */ - $oOrder = $d['oOrder']; - /** @var \wpsg_order_product $oOrderProduct */ - $oOrderProduct = $d['oOrderProduct']; +<?php foreach ($arSubmitData as $d) { $oOrder = $d['oOrder']; $oOrderProduct = $d['oOrderProduct']; ?> +<?php echo mb_str_pad(__('Bestellung', 'wpsg').':', 25); ?> <?php echo (($oOrder !== null)?$oOrder->getNr():$d['order_nr']); ?> -?> -<?php echo mb_str_pad(__('Bestellung', 'wpsg').':', 25); ?> <?php echo $oOrder->getNr(); ?> -<?php echo mb_str_pad(__('Produkt', 'wpsg').':', 25); ?> <?php echo $d['amount']; ?> x <?php echo $oOrderProduct->getProduct()->getProductName(true); ?> / <?php echo __('Artikelnummer', 'wpsg'); ?>: <?php echo $oOrderProduct->getProduct()->getNr(); ?> -<?php echo mb_str_pad(__('Ausgewählter Grund', 'wpsg').':', 25); ?> <?php echo array_values(array_filter($arReason, function($item) use ($d) { return $item['id'] === $d['reason']; }))[0]['text'] ?? __('Kein Grund angegeben', 'wpsg'); ?> -<?php echo mb_str_pad(__('Bemerkung', 'wpsg').':', 25); ?> <?php echo $d['comment']; ?> +<?php if ($oOrder !== null) { ?><?php echo mb_str_pad(__('Besteller', 'wpsg').':', 25); ?> <?php echo $oOrder->getCustomer()->getEMail(); ?> <?php } ?> +<?php echo mb_str_pad(__('Produkt', 'wpsg').':', 25); ?> <?php echo intval($d['amount']); ?> x <?php echo (($oOrderProduct !== null)?$oOrderProduct->getProduct()->getProductName(true).' / '.__('Artikelnummer', 'wpsg').': '.$oOrderProduct->getProduct()->getNr():$d['product_nr']); ?> + +<?php echo mb_str_pad(__('Bestätigt', 'wpsg').':', 25); ?> <?php echo (($d['confirmed'])?__('ja (Link aus der Bestellmail oder angemeldeter Besteller)', 'wpsg'):__('nein', 'wpsg')); ?> + +<?php echo mb_str_pad(__('Ausgewählter Grund', 'wpsg').':', 25); ?> <?php echo Revocation::reasonText((string)$d['reason']); ?> + +<?php echo mb_str_pad(__('Bemerkung', 'wpsg').':', 25); ?> <?php echo $d['comment']; ?> + +<?php foreach (Revocation::noteTexts($d['notes']) as $note) { ?><?php echo mb_str_pad(__('Vermerk', 'wpsg').':', 25); ?> <?php echo $note; ?> + +<?php } ?> + +<?php } ?> +<?php echo __('Bitte prüft den Vorgang und führt die Rückabwicklung (Storno / Rückerstattung) durch.', 'wpsg'); ?> + -<?php echo mb_str_pad(__('Datum des Widerrufs', 'wpsg').':', 25); ?> <?php echo date('d.m.Y H:i:s'); ?> - -<?php echo __('Bitte prüft den Vorgang und führt die Rückabwicklung (Storno / Rückerstattung) durch.', 'wpsg'); ?> +<?php echo __('Viele Grüße', 'wpsg'); ?> -<?php echo __('Viele Grüße', 'wpsg'); ?> <?php echo \wpsg_ShopController::getShop()->get_option('wpsg_shopdata_name'); ?> - <?php echo __('Team', 'wpsg'); ?>
\ No newline at end of file diff --git a/views/mods/mod_revocation/mails/mail_customer_html.phtml b/views/mods/mod_revocation/mails/mail_customer_html.phtml index 7430fe3..96ee023 100644 --- a/views/mods/mod_revocation/mails/mail_customer_html.phtml +++ b/views/mods/mod_revocation/mails/mail_customer_html.phtml @@ -2,76 +2,42 @@ /** @version 4.6.1 */ declare(strict_types=1); - + /** - * @author: Daniel Schmitzer - * @date: 14.04.26 - * @time: 09:21 + * Eingangsbestätigung an die eingetragene Adresse (HTML) * + * Nur die Angaben des Absenders, keine Daten aus der Bestellung (S18): Die Adresse hat der Absender selbst eingetragen. + * Ohne order_id versendet, Platzhalter wie %kunde_name% bleiben deshalb leer. */ - - namespace wpsgRevocation; - - $arSubmitData = \wpsg_ShopController::getShop()->view['arSubmitData'] ?? []; - $arReason = Revocation::getReasons(); - -?> -<p><?php echo __('Hallo', 'wpsg'); ?> %kunde_anrede% %kunde_name%,</p> - -<p><?php echo __('wir haben Ihren Widerruf erhalten und bedanken uns für Ihre Mitteilung.', 'wpsg'); ?></p> -<h3><?php echo __('Ihre Widerrufsanmeldung:', 'wpsg'); ?></h3> - -<?php foreach ($arSubmitData as $key => $d): + namespace wpsgRevocation; - $oOrder = $d['oOrder']; - $oOrderProduct = $d['oOrderProduct']; + $arSubmitData = \wpsg_ShopController::getShop()->view['arSubmitData'] ?? []; + $time = (string)($arSubmitData[0]['time'] ?? \current_time('mysql')); - $reasonText = array_values(array_filter( - $arReason, - function($item) use ($d) { - return $item['id'] === $d['reason']; - } - ))[0]['text'] ?? __('Kein Grund angegeben', 'wpsg'); ?> - - <div style="margin-bottom:20px; padding:15px; background-color:#f9f9f9; border-radius:5px;"> - <p style="margin:0 0 10px 0;"> - <strong><?php echo __('Bestellnummer', 'wpsg'); ?>:</strong> - <?php echo $oOrder->getNr(); ?> - </p> - - <p style="margin:0 0 10px 0;"> - <strong><?php echo __('Produkt', 'wpsg'); ?>:</strong> - <?php echo $d['amount']; ?> x <?php echo $oOrderProduct->getProduct()->getProductName(true); ?> - / <?php echo __('Artikelnr.', 'wpsg'); ?>: - <?php echo $oOrderProduct->getProduct()->getNr(); ?> - </p> - - <p style="margin:0 0 10px 0;"> - <strong><?php echo __('Grund', 'wpsg'); ?>:</strong> - <?php echo $reasonText; ?> - </p> - - <?php if (!empty($d['comment'])): ?> - <p style="margin:0 0 10px 0;"> - <strong><?php echo __('Bemerkung', 'wpsg'); ?>:</strong> - <?php echo nl2br(htmlspecialchars($d['comment'])); ?> - </p> - <?php endif; ?> - </div> - +<p><?php echo __('Hallo', 'wpsg'); ?> <?php echo \esc_html($arSubmitData[0]['name'] ?? ''); ?>,</p> + +<p><?php echo __('wir bestätigen den Eingang Ihrer Widerrufserklärung mit folgenden Angaben:', 'wpsg'); ?></p> + +<?php foreach ($arSubmitData as $d): ?> +<div style="margin-bottom:20px; padding:15px; background-color:#f9f9f9; border-radius:5px;"> + <p style="margin:0 0 10px 0;"><strong><?php echo __('Bestellnummer', 'wpsg'); ?>:</strong> <?php echo \esc_html($d['order_nr']); ?></p> + <?php if ($d['product_nr'] !== '') { ?><p style="margin:0 0 10px 0;"><strong><?php echo __('Artikelnr.', 'wpsg'); ?>:</strong> <?php echo \esc_html($d['product_nr']); ?></p><?php } ?> + <p style="margin:0 0 10px 0;"><strong><?php echo __('Menge', 'wpsg'); ?>:</strong> <?php echo intval($d['amount']); ?></p> + <p style="margin:0 0 10px 0;"><strong><?php echo __('Grund', 'wpsg'); ?>:</strong> <?php echo \esc_html(Revocation::reasonText((string)$d['reason'])); ?></p> + <?php if ($d['comment'] !== '') { ?><p style="margin:0 0 10px 0;"><strong><?php echo __('Bemerkung', 'wpsg'); ?>:</strong> <?php echo nl2br(\esc_html($d['comment'])); ?></p><?php } ?> +</div> <?php endforeach; ?> <p> - <strong><?php echo __('Widerrufdatum', 'wpsg'); ?>:</strong> - <?php echo date('d.m.Y H:i:s'); ?> + <strong><?php echo __('Name', 'wpsg'); ?>:</strong> <?php echo \esc_html($arSubmitData[0]['name'] ?? ''); ?><br> + <strong><?php echo __('E-Mail', 'wpsg'); ?>:</strong> <?php echo \esc_html($arSubmitData[0]['contact'] ?? ''); ?><br> + <strong><?php echo __('Eingang', 'wpsg'); ?>:</strong> <?php echo \esc_html(\mysql2date('d.m.Y H:i', $time)); ?> </p> -<!--<p>--><?php //echo __('Wir werden Ihren Widerruf nun schnellstmöglich bearbeiten und uns bei Fragen mit Ihnen in Verbindung setzen.', 'wpsg'); ?><!--</p>--> -<p><?php echo __('Bitte beachten Sie, dass die Prüfung der Wirksamkeit und Reichweite Ihrer Widerrufserklärung noch aussteht. Wir werden Ihre Mitteilung nun bearbeiten und uns bei Rückfragen mit Ihnen in Verbindung setzen.', 'wpsg'); ?></p> +<p><?php echo __('Dies ist eine Bestätigung des Eingangs. Die Prüfung der Wirksamkeit und Reichweite Ihrer Widerrufserklärung steht noch aus; wir melden uns bei Rückfragen.', 'wpsg'); ?></p> <p> - <?php echo __('Mit freundlichen Grüßen', 'wpsg'); ?><br> - <?php echo \wpsg_ShopController::getShop()->get_option('wpsg_shopdata_name'); ?> - - <?php echo __('Team', 'wpsg'); ?> -</p>
\ No newline at end of file + <?php echo __('Mit freundlichen Grüßen', 'wpsg'); ?><br> + <?php echo \esc_html(\wpsg_ShopController::getShop()->get_option('wpsg_shopdata_name')); ?> - <?php echo __('Team', 'wpsg'); ?> +</p> diff --git a/views/mods/mod_revocation/mails/mail_customer_text.phtml b/views/mods/mod_revocation/mails/mail_customer_text.phtml index 6dd0b92..5812b68 100644 --- a/views/mods/mod_revocation/mails/mail_customer_text.phtml +++ b/views/mods/mod_revocation/mails/mail_customer_text.phtml @@ -2,53 +2,46 @@ /** @version 4.6.1 */ declare(strict_types=1); - + /** - * @author: Daniel Schmitzer - * @date: 14.04.26 - * @time: 09:21 + * Eingangsbestätigung an die eingetragene Adresse * + * Nur die Angaben des Absenders, keine Daten aus der Bestellung (S18): Die Adresse hat der Absender selbst eingetragen. + * Ohne order_id versendet, Platzhalter wie %kunde_name% bleiben deshalb leer. */ - + namespace wpsgRevocation; - + $arSubmitData = \wpsg_ShopController::getShop()->view['arSubmitData'] ?? []; - $arReason = Revocation::getReasons(); + $time = (string)($arSubmitData[0]['time'] ?? \current_time('mysql')); -?><?php echo __('Hallo', 'wpsg'); ?> %kunde_anrede% %kunde_name%, +?><?php echo __('Hallo', 'wpsg'); ?> <?php echo ($arSubmitData[0]['name'] ?? ''); ?>, -<?php echo __('wir haben Ihren Widerruf erhalten und bedanken uns für Ihre Mitteilung.', 'wpsg'); ?> +<?php echo __('wir bestätigen den Eingang Ihrer Widerrufserklärung mit folgenden Angaben:', 'wpsg'); ?> -<?php echo __('Ihre Widerrufsanmeldung:', 'wpsg'); ?> +<?php foreach ($arSubmitData as $d): ?> +<?php echo mb_str_pad(__('Bestellnummer', 'wpsg').':', 20); ?> <?php echo $d['order_nr']; ?> -<?php foreach ($arSubmitData as $key => $d): +<?php if ($d['product_nr'] !== '') { ?><?php echo mb_str_pad(__('Artikelnr.', 'wpsg').':', 20); ?> <?php echo $d['product_nr']; ?> - $oOrder = $d['oOrder']; - $oOrderProduct = $d['oOrderProduct']; +<?php } ?> +<?php echo mb_str_pad(__('Menge', 'wpsg').':', 20); ?> <?php echo intval($d['amount']); ?> - $reasonText = array_values(array_filter( - $arReason, - function($item) use ($d) { - return $item['id'] === $d['reason']; - } - ))[0]['text'] ?? __('Kein Grund angegeben', 'wpsg'); -?> +<?php echo mb_str_pad(__('Grund', 'wpsg').':', 20); ?> <?php echo Revocation::reasonText((string)$d['reason']); ?> -<?php echo mb_str_pad(__('Bestellnummer', 'wpsg').':', 20); ?> <?php echo $oOrder->getNr(); ?> +<?php if ($d['comment'] !== '') { ?><?php echo mb_str_pad(__('Bemerkung', 'wpsg').':', 20); ?> <?php echo $d['comment']; ?> -<?php echo mb_str_pad(__('Produkt', 'wpsg').':', 20); ?> <?php echo $d['amount']; ?> x <?php echo $oOrderProduct->getProduct()->getProductName(true); ?> / <?php echo __('Artikelnr.', 'wpsg'); ?>: <?php echo $oOrderProduct->getProduct()->getNr(); ?> +<?php } ?> -<?php echo mb_str_pad(__('Grund', 'wpsg').':', 20); ?> <?php echo $reasonText; ?> +<?php endforeach; ?> +<?php echo mb_str_pad(__('Name', 'wpsg').':', 20); ?> <?php echo ($arSubmitData[0]['name'] ?? ''); ?> -<?php if (!empty($d['comment'])): ?> -<?php echo mb_str_pad(__('Bemerkung', 'wpsg').':', 20); ?> <?php echo $d['comment']; ?> -<?php endif; ?> +<?php echo mb_str_pad(__('E-Mail', 'wpsg').':', 20); ?> <?php echo ($arSubmitData[0]['contact'] ?? ''); ?> + +<?php echo mb_str_pad(__('Eingang', 'wpsg').':', 20); ?> <?php echo \mysql2date('d.m.Y H:i', $time); ?> -<?php endforeach; ?> -<?php echo mb_str_pad(__('Widerrufdatum', 'wpsg').':', 20); ?> <?php echo date('d.m.Y H:i:s'); ?> +<?php echo __('Dies ist eine Bestätigung des Eingangs. Die Prüfung der Wirksamkeit und Reichweite Ihrer Widerrufserklärung steht noch aus; wir melden uns bei Rückfragen.', 'wpsg'); ?> -<?php echo __('Wir werden Ihren Widerruf nun schnellstmöglich bearbeiten und uns bei Fragen mit Ihnen in Verbindung setzen.', 'wpsg'); ?> -<?php echo __('Bitte beachten Sie, dass die Prüfung der Wirksamkeit und Reichweite Ihrer Widerrufserklärung noch aussteht. Wir werden Ihre Mitteilung nun bearbeiten und uns bei Rückfragen mit Ihnen in Verbindung setzen.', 'wpsg'); ?> <?php echo __('Mit freundlichen Grüßen', 'wpsg'); ?> diff --git a/views/mods/mod_revocation/order_view_row.phtml b/views/mods/mod_revocation/order_view_row.phtml index 7261e8a..9bfd17f 100644 --- a/views/mods/mod_revocation/order_view_row.phtml +++ b/views/mods/mod_revocation/order_view_row.phtml @@ -18,6 +18,9 @@ <td colspan="5"> <?php echo __('Widerruf', 'wpsg'); ?>: <?php echo wpsg_translate(__('#1# Stück am #2# widerrufen', 'wpsg'), $row['amount'], \wp_date('d. F Y H:i:s', strtotime($row['time']))); ?> + <?php if (($row['name']??'') !== '') echo ' · '.esc_html($row['name']).' ('.esc_html((string)($row['contact']??'')).')'; ?> + <?php if (isset($row['confirmed'])) echo ' · '.(($row['confirmed'])?esc_html__('bestätigt', 'wpsg'):esc_html__('unbestätigt', 'wpsg')); ?> + <?php $arNotes = \wpsgRevocation\Revocation::noteTexts((array)($row['notes']??[])); if (sizeof($arNotes) > 0) echo ' · '.esc_html(implode(', ', $arNotes)); ?> </td> </tr> diff --git a/views/mods/mod_revocation/page_form.phtml b/views/mods/mod_revocation/page_form.phtml index c444916..f76b2b8 100644 --- a/views/mods/mod_revocation/page_form.phtml +++ b/views/mods/mod_revocation/page_form.phtml @@ -19,12 +19,14 @@ // Vorbelegung des Kontaktfeldes für eingeloggte Kunden $contact_email = ''; + $contact_name = ''; $customer_login_id = intval(\wpsg_ShopController::getShop()->callMod('wpsg_mod_kundenverwaltung', 'isLoggedIn')); if ($customer_login_id > 0) { $oCustomer = \wpsg_customer::getInstance($customer_login_id); $contact_email = $oCustomer->getEmail(); + $contact_name = trim($oCustomer->getFirstname().' '.$oCustomer->getName()); } @@ -33,6 +35,7 @@ $get_product = isset($_GET['wpsg_revo_product']) ? \sanitize_text_field($_GET['wpsg_revo_product']) : ''; $get_amount = isset($_GET['wpsg_revo_amount']) ? max(1, intval($_GET['wpsg_revo_amount'])) : 1; $get_contact = isset($_GET['wpsg_revo_contact']) ? \sanitize_email($_GET['wpsg_revo_contact']) : ''; + $get_key = isset($_GET['wpsg_revo_key']) ? \sanitize_key($_GET['wpsg_revo_key']) : ''; // Schlüssel aus der Bestellmail (S18) if ($contact_email === '' && $get_contact !== '' && \is_email($get_contact)) $contact_email = $get_contact; @@ -85,6 +88,15 @@ </fieldset> <div class="form_field"> + <label class="label" for="wpsg_rvp_name"><?php echo \__('Name', 'wpsg'); ?></label> + <div class="value"> + <input type="text" required id="wpsg_rvp_name" autocomplete="name" name="wpsg_revocation_reason[name]" value="<?php echo \esc_attr($contact_name); ?>" /> + </div> + </div> + + <input type="hidden" name="wpsg_revocation_reason[key]" value="<?php echo \esc_attr($get_key); ?>" /> + + <div class="form_field"> <label class="label" for="wpsg_rvp_contact"><?php echo \__('Kontakt - E-Mail', 'wpsg'); ?></label> <div class="value"> <input type="email" required id="wpsg_rvp_contact" autocomplete="email" name="wpsg_revocation_reason[contact]" value="<?php echo \esc_attr($contact_email); ?>" @@ -194,7 +206,7 @@ } else { form.style.display = 'none'; - msg.innerHTML = '<div class="wpsg_revocation_page_success"><?php echo \esc_js(\__('Ihr Widerruf ist bei uns eingegangen und wird nun bearbeitet.', 'wpsg')); ?></div>'; + msg.innerHTML = '<div class="wpsg_revocation_page_success"><?php echo \esc_js(\__('Ihre Widerrufserklärung ist eingegangen. Die Eingangsbestätigung geht an die angegebene E-Mail-Adresse.', 'wpsg')); ?></div>'; msg.scrollIntoView({ behavior: 'smooth', block: 'center' }); } diff --git a/views/mods/mod_revocation/wp_footer.phtml b/views/mods/mod_revocation/wp_footer.phtml index ef013c2..c210881 100644 --- a/views/mods/mod_revocation/wp_footer.phtml +++ b/views/mods/mod_revocation/wp_footer.phtml @@ -177,7 +177,7 @@ success.className = 'wpsg_revocation_page_success'; success.setAttribute('role', 'status'); success.tabIndex = -1; - success.textContent = <?php echo wp_json_encode(__('Ihr Widerruf ist bei uns eingegangen und wird nun bearbeitet.', 'wpsg')); ?>; + success.textContent = <?php echo wp_json_encode(__('Ihre Widerrufserklärung ist eingegangen. Die Eingangsbestätigung geht an die angegebene E-Mail-Adresse.', 'wpsg')); ?>; el_dialog_content.replaceChildren(success); el_dialog.querySelector('.wpsg_revocation_button_submit').hidden = true; @@ -323,6 +323,7 @@ const get_product_nr = urlParams.get('wpsg_revo_product'); const get_amount = urlParams.get('wpsg_revo_amount'); const get_contact = urlParams.get('wpsg_revo_contact'); + const get_key = urlParams.get('wpsg_revo_key'); if (get_order_nr !== null) { @@ -373,6 +374,15 @@ } + // Schlüssel aus der Bestellmail bestätigt den Widerruf (S18) + if (get_key) { + + const keyInput = form.querySelector('input[name="wpsg_revocation_reason[key]"]'); + + if (keyInput) keyInput.value = get_key; + + } + }; checkAndFillForm(); |
