If you have a Bigcommerce store, you already know that part of the messages (especially the error messages) are hard to change. The messages in the LNG variables can be easily modified, but others require customization.
Have you ever searched for a way to change the "Unable to ship to this location" message?
Recently, Bigcommerce has implemented a way to edit that message for the checkout page. In order to change it, login to your admin panel, go under Setup & Tools->Shipping-> scroll down on that page, and Edit the message, like in this screenshot:
After writing your custom message, it will show up on your store's frontend like this:
For the cart page however, the default message still remains:
Because of this, the cart page requires customization. I tested a few Javascript codes, and found out that we need to trigger our code after the ajax loads.
There is a new method available .ajaxComplete() which allows you to modify something, after ajax loads.
I created this code:
<script type="text/javascript">
$( document ).ajaxComplete(function( event,request, settings ) {
$( ".ShippingMethodList p strong" ).html( "I only ship to US" );
});
</script>
And I added it under Design->Edit HTML/CSS->cart.html at the bottom of that file, right before the body tag will close, like this:
The code ".ShippingMethodList p strong" allows the text to change like this:
Inside the code, you can change the text, to the one you want to show, and allow your customers to see your custom message instead of the default one.
I hope you enjoyed this article and you will find it useful. Thank you for reading it!