• Closed by: Anonymous Submitter
  • Closed on:
  • Reason: Not a bug

Ticket #23191 - Checkout amp

hi,
in the purchase phase in the amp version if I click on “I accept the terms of service… " the page is reloaded and you can not continue with the purchase.

View the video to replicate the error.

Thank you,

Comments

Fred 23 Mar 2022, 17:29

Hi, Stefano.
Please Try to add following code into Theme Settings → Customer JS input field

function updateForClosing(element) {
    const parent = element.closest('amp-sidebar');
    parent.removeAttribute('open');
    parent.removeAttribute('i-amphtml-sidebar-opened');
    element.removeAttribute('open');
    element.removeAttribute('i-amphtml-sidebar-opened');
    document.documentElement.classList.remove('i-amphtml-scroll-disabled');
    document.documentElement.removeAttribute('style');
    $('.amp-sidebar-mask').attr('hidden', true);
    $('.amp-sidebar-mask').attr('open', false);
}

$(document).ready(function()
{
    if (prestashop.page.page_name === 'module-pkamp-order') {
        $('body').on('click', '.amp-close-image', (e) => {
            e.preventDefault();
            updateForClosing(e.target)
        });
        $('body').on('click', '[on="tap:selector-tos.close"]', (e) => {
            e.preventDefault();
            updateForClosing(e.target)
        });
    }
});
Stefano Antonelli 24 Mar 2022, 09:43

Salve,
grazie per aver risposto.

Ho incollato il codice nel js custom del tema, cancellato cache sito e browser ma nulla l’errore rimane anche cambiando browser.

Fred 24 Mar 2022, 11:20

Please try now, it should be fixed

Stefano Antonelli 25 Mar 2022, 09:50

Tutto ok, la ringrazio. Buona giornata Fred.

Fred 25 Mar 2022, 09:51

You are welcome!