Start a conversation

Add an alert on Checkout page

Go to Admin panel > Storefront > Script Manager. Add a script with the value

Name of script: Alert on Checkout page

Location on page: Footer

Select pages where script will be added: Checkout

Script type: Script

Script contents:

<script>
    (function() {
        var alert = 'YOUR ALERT CONTENT';

        var elm = document.createElement('div');
        elm.setAttribute('class', 'layout');
        elm.style.padding = '1.5rem';
        elm.style.minHeight = '0';
        elm.innerHTML = '<div class="alertBox alertBox--warning">' + alert + '</div>';

        var heading = document.querySelector('.page-heading');

        if (!heading) {
            heading = document.querySelector('header');
        }

        heading.parentNode.insertBefore(elm, heading.nextElementSibling);
    })();
</script>


see screenshot 

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Papathemes

  2. Posted

Comments