Woocommerce

Modo de vacaciones / Desactivar tienda WooCommerce

2 Genial hay muchos Likes :D

add_action ('init', 'novaweb_woocommerce_holiday_mode');

// Desactivar carrito, Checkout, Agregar al carrito

function novaweb_woocommerce_holiday_mode() {
   remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
   remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
   remove_action( 'woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20 );
   remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );
   add_action( 'woocommerce_before_main_content', 'novaweb_wc_shop_disabled', 5 );
   add_action( 'woocommerce_before_cart', 'novaweb_wc_shop_disabled', 5 );
   add_action( 'woocommerce_before_checkout_form', 'novaweb_wc_shop_disabled', 5 );
}

// Mensaje

function novaweb_wc_shop_disabled() {
        wc_print_notice( 'Nuestra tienda online está cerrada hoy)', 'error');
}