summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--views/mods/mod_revocation/ajaxDialogContent.phtml9
-rw-r--r--views/mods/mod_revocation/settings_edit.phtml6
-rw-r--r--views/mods/mod_revocation/wp_footer.phtml19
-rw-r--r--views/mods/mod_revocation/wpsg_revocation.css23
4 files changed, 52 insertions, 5 deletions
diff --git a/views/mods/mod_revocation/ajaxDialogContent.phtml b/views/mods/mod_revocation/ajaxDialogContent.phtml
index e833a00..b221e31 100644
--- a/views/mods/mod_revocation/ajaxDialogContent.phtml
+++ b/views/mods/mod_revocation/ajaxDialogContent.phtml
@@ -12,8 +12,9 @@
use \wpsg\M1;
use wpsg_product;
+ use wpsg_ShopController;
- $arReason = \wpsgRevocation\Revocation::getReasons();
+$arReason = \wpsgRevocation\Revocation::getReasons();
// Produkte
$dialog_config = json_decode((wp_kses_stripslashes($_REQUEST['dialog_config']??'[]')), true);
@@ -100,7 +101,7 @@
<fieldset class="wpsg_revocation_order_product">
<div class="form_field">
- <div class="label"><?php echo __('Produkt - Nr.', 'wpsgRevocation'); ?></div>
+ <div class="label"><?php echo __('Artikel - Nr.', 'wpsgRevocation'); ?></div>
<div class="value">
<input type="text" name="wpsg_revocation_reason[row][<?php echo $key; ?>][product_nr]" value="<?php echo ($dialog_config['set_product_anr']??''); ?>" />
</div>
@@ -145,4 +146,8 @@
</div>
</div>
+ <p>
+ Es gelten unsere <?php echo '<a href="' . $GLOBALS['wpsg_sc']->getURL(wpsg_ShopController::URL_DATENSCHUTZ) . '">Datenschutzbestimmungen</a>' ?>
+ </p>
+
</form> \ No newline at end of file
diff --git a/views/mods/mod_revocation/settings_edit.phtml b/views/mods/mod_revocation/settings_edit.phtml
index fbab6a1..c47b46b 100644
--- a/views/mods/mod_revocation/settings_edit.phtml
+++ b/views/mods/mod_revocation/settings_edit.phtml
@@ -30,6 +30,12 @@
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_revocation_view_product', __('Im Produkt neben "In den Warenkorb" anzeigen.', 'wpsgRevocation'), wpsg_ShopController::getShop()->get_option('wpsg_mod_revocation_view_product'), ['fullWidth' => true]); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_revocation_view_customer_mail', __('Widerruflink in Bestellbestätigungsmail an Kunden.', 'wpsgRevocation'), wpsg_ShopController::getShop()->get_option('wpsg_mod_revocation_view_customer_mail'), ['fullWidth' => true]); ?>
+ <hr />
+
+ <div v-pre>
+ <?php echo wpsg_drawForm_Select('wpsg_page_widerrufsformular', __('Seite für das Widerrufsformular', 'wpsgRevocation'), wpsg_ShopController::getShop()->view['pages'], wpsg_ShopController::getShop()->get_option('wpsg_page_widerrufsformular'), ['hint' => __('Wählen Sie „Neu anlegen und zuordnen", damit beim Speichern automatisch eine eigene Seite erstellt wird – oder ordnen Sie eine bestehende Seite zu. Das Formular wird automatisch in diese Seite eingebunden.', 'wpsgRevocation')]); ?>
+ </div>
+
<p class="wpsg_note">
<?php echo wpsg_translate(
__('Einstellungen zu den E-Mails finden Sie in der <a href="#1#">E-Mail Konfiguration</a>.', 'wpsgRevocation'),
diff --git a/views/mods/mod_revocation/wp_footer.phtml b/views/mods/mod_revocation/wp_footer.phtml
index c51c586..3c4f9c8 100644
--- a/views/mods/mod_revocation/wp_footer.phtml
+++ b/views/mods/mod_revocation/wp_footer.phtml
@@ -200,7 +200,9 @@
});
- };
+ setTimeout(() => {document.querySelector('[name="wpsg_revocation_reason[row][0][product_nr]"]')?.focus();}, 1000)
+
+ };
// Button am Produkt
document.querySelectorAll('.wpsg_revocation_product_button').forEach(el => {
@@ -215,7 +217,20 @@
// Button Listener FlyOut
document.getElementById('wpsg_revocation_button').addEventListener('click', event => { open_dialog(); });
-
+
+ // Shortcode-Link Listener [wpshopgermany_widerruf]
+ document.addEventListener('click', event => {
+
+ const link = event.target.closest('a.wpsg_revocation_link');
+
+ if (link === null) return;
+
+ event.preventDefault();
+ open_dialog();
+
+ });
+
+
// GET Parameter verarbeiten
const urlParams = new URLSearchParams(window.location.search);
diff --git a/views/mods/mod_revocation/wpsg_revocation.css b/views/mods/mod_revocation/wpsg_revocation.css
index 0cf6e01..7d6a9ea 100644
--- a/views/mods/mod_revocation/wpsg_revocation.css
+++ b/views/mods/mod_revocation/wpsg_revocation.css
@@ -63,4 +63,25 @@
.wpsg_amount_label {
word-break: normal;
-} \ No newline at end of file
+}
+/* Eigenständige Widerrufsformular-Seite (kein Popup) */
+.wpsg_revocation_page { width:100%; max-width:800px; margin:0 auto; }
+
+#wpsg_revocation_page_form { display:flex; flex-direction:column; gap:0.5rem; width:100%;
+ .wpsg_revocation_order_product { border:1px solid #ddd; border-radius:0.5rem; padding:1rem; margin:0 0 1rem 0; }
+ .wpsg_revocation_order_product > div { width:100%; }
+ .form_field { display:flex; width:100%; flex-direction:column; gap:0.125rem;
+ .label { color:black; font-size:1.25rem; }
+ .value { display:flex; justify-content:stretch; gap:0.25rem;
+ input, textarea, select { width:auto; flex-grow:1; min-height:30px; text-indent:0.25rem; flex-shrink:1; }
+ textarea { min-height:90px; padding:0.25rem; }
+ select { height:36px; }
+ input[type="number"] { flex-shrink:2; flex-grow:0; }
+ }
+ }
+ #wpsg_error, .wpsg_error { padding-left:5px; color:red; list-style:none; margin:0 0 1rem 0; }
+ .wpsg_revocation_page_submit_wrap { margin-top:0.5rem; }
+}
+
+.wpsg_revocation_page_success { padding:1rem; border:1px solid #2e7d32; border-radius:0.5rem; background:#edf7ed; color:#2e7d32; }
+.wpsg_revocation_page_datenschutz { margin:0.5rem 0; }