From c49c6c3b5ebfbef2b47567104043abb2f0229cc4 Mon Sep 17 00:00:00 2001 From: Jean-Luc Beer Date: Wed, 1 Jul 2026 05:57:32 +0000 Subject: Widerrufsformular Shortcode + dedizierte wp_posts-Seite git-svn-id: https://[internal]/wordpress/plugins/wpsg4@8535 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/mods/mod_revocation/ajaxDialogContent.phtml | 9 +++++++-- views/mods/mod_revocation/settings_edit.phtml | 6 ++++++ views/mods/mod_revocation/wp_footer.phtml | 19 +++++++++++++++++-- views/mods/mod_revocation/wpsg_revocation.css | 23 ++++++++++++++++++++++- 4 files changed, 52 insertions(+), 5 deletions(-) (limited to 'views') 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 @@
-
+
@@ -145,4 +146,8 @@
+

+ Es gelten unsere getURL(wpsg_ShopController::URL_DATENSCHUTZ) . '">Datenschutzbestimmungen' ?> +

+ \ 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 @@ get_option('wpsg_mod_revocation_view_product'), ['fullWidth' => true]); ?> get_option('wpsg_mod_revocation_view_customer_mail'), ['fullWidth' => true]); ?> +
+ +
+ 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')]); ?> +
+

E-Mail Konfiguration.', '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; } -- cgit v1.2.3