Last active
June 28, 2023 09:43
-
-
Save varun-pluginhive/9938137d3a7f8e6b910109267f61e88f to your computer and use it in GitHub Desktop.
Add message to the WooCommerce cart page.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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