How to Hook to Shopengine
-
I have a scenario where I need to disable add to cart after Saturday to wednesday. I used the following code to do so:
// Trigger Holiday Mode add_action ('init', 'woocommerce_holiday_mode'); // Disable Cart, Checkout, Add Cart function woocommerce_holiday_mode() { if (date(D) ==( "Sat" || "Sun" || "Mon" || "Tues" || "Wed")){ 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', 'wc_shop_disabled', 5 ); add_action( 'woocommerce_before_cart', 'wc_shop_disabled', 5 ); add_action( 'woocommerce_before_checkout_form', 'wc_shop_disabled', 5 ); } // Show Holiday Notice function wc_shop_disabled() { wc_print_notice( 'Our Online Shop is Closed Today :)', 'error'); } }
It worked perfectly until I designed my page with shopengine. Now it is not taking those codes, as those are for woocomerce. How to hook this with shopengine?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to Hook to Shopengine’ is closed to new replies.