Snippets

Visser Labs Temporarily blocking Checkout

Created by Michael Visser

File functions.php Added

  • Ignore whitespace
  • Hide word diff
+<?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' );
+
+?>
HTTPS SSH

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