Display message when State, Post Code or Country is not filled in cart page

This code snippet displays  a custom message when State, Post Code or Country is not filled in cart page.

Add the following code in Appearance –> Editor –> functions.php.


As shown from the screenshot below, this snippet displays the message “Postcode is empty.Please fill up the field” when post code is not entered.

Cart with the Message

Cart with the Message

Leave a Reply