diff --git a/blocks/order-form/order-form.css b/blocks/order-form/order-form.css new file mode 100644 index 0000000..92805f2 --- /dev/null +++ b/blocks/order-form/order-form.css @@ -0,0 +1,5 @@ +.order-form .table_order button { + font-size: 12px!important; + padding: 0.8em 0.9em!important; + transition: all 0.3s ease; +} \ No newline at end of file diff --git a/blocks/order-form/order-form.js b/blocks/order-form/order-form.js new file mode 100644 index 0000000..f64c255 --- /dev/null +++ b/blocks/order-form/order-form.js @@ -0,0 +1,20 @@ +export default function buildAutoBlocks(block) { + const para = block.innerText; + block.innerHTML = para; + const forms = block.querySelectorAll('form'); + forms.forEach((form) => { + const originalUrl = form.action; + const continueUrl = window.location.href; + // Replace the 'continue' parameter or add it if it doesn't exist + form.action = originalUrl.replace(/(\?|&)continue=([^&]*)/, `$1continue=${continueUrl}`); + }); + const accordions = block.querySelectorAll('.mmg-collapsible'); + if (accordions.length > 0) { + accordions.forEach((accordion) => { + accordion.children[0].addEventListener('click', () => { + const content = accordion.querySelector('.content'); + content.style.display = content.style.display === 'none' ? 'block' : 'none'; + }); + }); + } +}