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

1253 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

  • How to Delete or Deactivate Promo Codes 3720 0
  • How to Generate Sitemaps and the Google Product Feed 3629 0
  • Enable Cloudflare Rate Limiting 3071 0
  • Enable Firewall Rules and a JavaScript Browser Challenge 2865 16
  • IP Allowlist 2611 0

New Articles

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