Skip to content

Instantly share code, notes, and snippets.

@varun-pluginhive
Last active June 28, 2023 09:43
Show Gist options
  • Save varun-pluginhive/9938137d3a7f8e6b910109267f61e88f to your computer and use it in GitHub Desktop.
Save varun-pluginhive/9938137d3a7f8e6b910109267f61e88f to your computer and use it in GitHub Desktop.
Add message to the WooCommerce cart page.
/**
* Add message to the cart page.
* Created at : 17 Dec 2018
* Updated at : 17 Dec 2018
* PluginHive Plugins : https://www.pluginhive.com/plugins/
* Gist Link : https://gist.github.com/varun-pluginhive/9938137d3a7f8e6b910109267f61e88f
*/
add_action( 'woocommerce_init', function(){
$message = "Please proceed to the Checkout page to get the UPS AccessPoint option as delivery option."; // Provide the message
$request_url = $_SERVER['REQUEST_URI'];
if(is_cart() || strpos( $request_url, 'cart' ) !== false )
wc_add_notice($message);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment