commercebuild Success Portal commercebuild Success Portal

  • Home
  • Submit a Ticket
  • Updates
  • Login
  • Contact Us
Home / Tutorials / How to Add a Custom Message to Your Web Store Checkout

How to Add a Custom Message to Your Web Store Checkout

621 views Less than a minute 0

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:

webstore Tutorials

About Bradly Hale

View all posts by Bradly Hale →

Related Articles

  • How to Enable reCAPTCHA on Custom Forms
  • Adding a custom message to the shipping step at checkout
  • How to configure Stripe as a payment method
  • SQL Server Change Tracking Query for Sage 300 and X3

Popular Articles

  • Enable Firewall Rules and a JavaScript Browser Challenge 2247 16
  • Enable Cloudflare Rate Limiting 2134 0
  • How to Add a JavaScript Snippet 1994 8
  • IP Allowlist 1945 0
  • Signing up for Cloudflare and Configuring Your Domain 1812 4

New Articles

  • Error when adding a new user: Email is already in use 676 0
  • How to Check commercebuild Payments Version 913 0
  • How to Enable reCAPTCHA on Custom Forms 820 0
  • Manually posting an order 970 0
  • Adding a custom message to the shipping step at checkout 785 0
© commercebuild 2022. All rights reserved.