How to Add a Custom Message to Your Web Store Checkout

1,952 views · 1 min read · Tutorials

Currently it is not possible to add a custom message to your checkout page via a store setting. However, with this JavaScript snippet in a Custom Tags (System > Modules > Custom Tags) section, you should be able to add a custom message of your choice.

<script>
if (window.location.href.indexOf("/checkout/") != -1) {
    $(document).ready(function() {
        var subject = "Notice:";
        var msg = "We are experiencing shipping delays at this time due to COVID-19. We apologize for any inconveniences this may cause. If you have questions, please reach out to support@sales.com, and we will be happy to assist you further. Thank you for your patience and understanding, and stay safe and healthy.";
        var bg_color = "#FF0000";
        var text_color = "#FFFFFF";
        var font_size = "1.5em";

        $("<div style='width:96%; padding:2%; margin:2% auto; background:" + bg_color + "; color:" + text_color + "; text-align:center; font-size:" + font_size + "; border-radius:30px;'><strong>" + subject + "</strong> " + msg + "</div>").insertBefore(".cart-body");
    });
}
</script>

Feel free to modify the variables to reflect your message as well as font color, font size and background color.


This is how your code would appear in System > Modules > Custom Tags:


This is how it would look on your checkout page:

Was this article helpful?

Thanks for the feedback.

Need further assistance?

Email support@commercebuild.com or open a ticket and we'll get back to you.

Submit a ticket