Shipping Can't be calculated message

Hi there -

We wanted to modify the message received on the cart when shipping can not be calculated. We found this post, https://theme.co/apex/forum/t/x-alert-woocommerce/42607

I tried it on our development site and it worked well.

Three questions.

First, if we want to modify the message, do we edit both text areas?

See the two sections between ->>>> <<<<-

if ( is_cart() ) {
return ‘

’ . __( ‘->>>>There doesn‘t seem to be any available shipping methods. Please double check your address, or contact us if you need any help.<<<<-’, ‘x’ ) . ‘

’;
} else {
return ‘

’ . __( ‘->>>>There doesn‘t seem to be any available shipping methods. Please double check your address, or contact us if you need any help.<<<<-’, ‘x’ ) . ‘

’;

}

Second, can we include html within the message? For example, make the contact us a hyperlink to the contact us page? On our development site I created a hyperlink and it appeared fine.

Third, is there a code snippet for modifying the message that shipping cant be calculated on checkout page? Currently when shipping cant be calculated checkout provides this message, "There are no shipping options available. Please ensure that your address has been entered correctly, or contact us if you need any help. "

Thanks

Tim

Hi Tim,

Thanks for writing in! If you follow that example post, the first code fragment is for the cart page (is_cart()) and the other code fragment is for the other pages. If you want to change all pages, you need to edit both occurrences.

Also if you check that code, it’s already integrated with HTML. You can also see a basic example from here on concatenation (https://stackoverflow.com/a/26497182/1978139).

For the third question, please refer to the following resource (https://aceplugins.com/doc/advanced-shipping-for-woocommerce/how-to-change-the-no-shipping-methods-available-message/).

Thanks!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.