diff --git a/composer.json b/composer.json index 2e1d153..ccace32 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "slinicraftet204/notifyifavail", "description": "benachrichtigt Kunden, sobald ein Produkt wieder verfügbar ist", - "version": "0.1.48", + "version": "0.1.492", "type": "shopware-platform-plugin", "license": "MIT", "authors": [ diff --git a/src/Resources/public/js/notify-me.js b/src/Resources/public/js/notify-me.js index 625a5fa..a8719f0 100644 --- a/src/Resources/public/js/notify-me.js +++ b/src/Resources/public/js/notify-me.js @@ -7,19 +7,25 @@ document.addEventListener('DOMContentLoaded', function () { return; } - const notifyButton = document.getElementById('notify-me-button'); - const submitButton = document.getElementById('submit-notify'); - const emailInput = document.getElementById('notify-me-email'); + console.log("✅ NotifyMe: Container gefunden"); + + const notifyButton = document.querySelector('.notify-me-button'); + const submitButton = document.querySelector('.notify-me-submit'); + const emailInput = document.querySelector('.notify-me-email'); if (notifyButton) { + console.log("✅ NotifyMe: Button gefunden"); notifyButton.addEventListener('click', function () { const email = this.dataset.customerEmail; const productId = this.dataset.productId; sendNotificationRequest(email, productId); }); + } else { + console.error("❌ NotifyMe: Button nicht gefunden!"); } if (submitButton) { + console.log("✅ NotifyMe: Submit-Button gefunden"); submitButton.addEventListener('click', function () { const email = emailInput.value; const productId = this.dataset.productId; @@ -31,6 +37,8 @@ document.addEventListener('DOMContentLoaded', function () { sendNotificationRequest(email, productId); }); + } else { + console.error("❌ NotifyMe: Submit-Button nicht gefunden!"); } function sendNotificationRequest(email, productId) { diff --git a/src/Resources/views/storefront/page/product-detail/index.html.twig b/src/Resources/views/storefront/page/product-detail/buy-widget.html.twig similarity index 57% rename from src/Resources/views/storefront/page/product-detail/index.html.twig rename to src/Resources/views/storefront/page/product-detail/buy-widget.html.twig index 7c86985..9c4d127 100644 --- a/src/Resources/views/storefront/page/product-detail/index.html.twig +++ b/src/Resources/views/storefront/page/product-detail/buy-widget.html.twig @@ -1,29 +1,20 @@ +{% sw_extends '@Storefront/storefront/page/product-detail/buy-widget.html.twig' %} + {% block page_product_detail_price %} {{ parent() }} -
- {{ product.calculatedPrice.unitPrice|currency }}* -
-