Snippets

Visser Labs Temporarily blocking Checkout

Created by Michael Visser
<?php

// Prevents Checkout and displays a notice to customers
function custom_woocommerce_prevent_checkout() {

	$message = 'Checkout is locked until 00:01 when the big sale begins.';
	wc_add_notice( $message, 'error' );

}
add_action( 'woocommerce_check_cart_items', 'custom_woocommerce_prevent_checkout' );

?>

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.