// Trigger Holiday Mode add_action ('init', 'arrow_design_woocommerce_holiday_mode'); // Disable Cart, Checkout, Add Cart function arrow_design_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', 'arrow_design_wc_shop_disabled', 5 ); add_action( 'woocommerce_before_cart', 'arrow_design_wc_shop_disabled', 5 ); add_action( 'woocommerce_before_checkout_form', 'arrow_design_wc_shop_disabled', 5 ); } // Show Holiday Notice function arrow_design_wc_shop_disabled() { wc_print_notice( 'Our Online Shop is Closed Today :)', 'error'); }
Conclusion
We hope this Activate Woocommerce Holiday/Pause Mode post was helpful and you are now able to integrate this also on your website! You can find more articles here:
Read another Woocommerce post : ‘Remove the Woocommerce Checkout Fields‘
Arrow Design, based in Dublin, Ireland, provides quality website design services in Dublin and beyond at affordable prices. If you would like help with implementing the above code, or any wordpress website development project, contact us. We love website design and it shows! We provide custom wordpress plugin development, website design training and lots more.
We do it all, so you don’t have to!
Related Posts
Woocommerce Account Page Hook Guide
In this article you will find a visual hook guide for the Woocommerce Account Pages, like the Login/Register page, the Downloads page or the Orders page.
Woocommerce Single Product Page Hook Guide
In this article you will find a visual hook guide for the Woocommerce Single Product Page. This should help you to quickly and easily find the hook positions on the page.
Woocommerce PHP – Product Categories by Product ID
In this tutorial you will learn how to check if a product is assigned to a tag, a category or a custom taxonomy. You can check if a product is is on the shop page, in the cart, in an order & more.
…We do more, so you can do less 🙂