commercebuild Success Portal commercebuild Success Portal

  • Home
  • Submit a Ticket
  • Updates
  • Login
  • Contact Us
Home / Tutorials / Adding a custom message to the shipping step at checkout

Adding a custom message to the shipping step at checkout

900 views Less than a minute 0

There might be times that you want to display a custom message in the shipping step at checkout. For example:

You can achieve this with a little JavaScript placed under “System → Modules → Custom Tags”. You will want to be sure that you select the options “Position: Footer” and “Page Type: Cart”.

Once that is created, you can copy/paste in the following JavaScript:

<script>
if(window.location.href.indexOf("/checkout/onepage") > -1) {
$(document).ajaxComplete(function( event, xhr, settings ) {
var active_step = $('.active').attr('id');
if ( active_step == 'opc-shipping_method' ) {
$('<span style="display:block; text-align:left; color:red; font-weight:bold;">My custom shipping message</span>').insertAfter('.box-sp-methods');
}
});
}
</script>

Note that there is the word insertAfter. This appends the message to the end of the shipping options. If you want the message to appear first, before any shipping options, you would use insertBefore.

Tutorials

About Jess

View all posts by Jess →

Related Articles

  • How to Enable reCAPTCHA on Custom Forms
  • How to configure Stripe as a payment method
  • SQL Server Change Tracking Query for Sage 300 and X3
  • Enable Product Level Warehouse Restriction

Popular Articles

  • Enable Firewall Rules and a JavaScript Browser Challenge 2482 16
  • Enable Cloudflare Rate Limiting 2453 0
  • How to Add a JavaScript Snippet 2198 8
  • IP Allowlist 2124 0
  • Signing up for Cloudflare and Configuring Your Domain 2048 4

New Articles

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