jamesgol / woocommerce-cart-stock-reducer

Allow WooCommerce inventory stock to be reduced when adding items to cart
GNU General Public License v2.0
58 stars 19 forks source link

Add option to display countdown only on cart/checkout page #55

Open jamesgol opened 6 years ago

jamesgol commented 6 years ago

Requested by user https://wordpress.org/support/topic/custom-some-features/

hzengler commented 5 years ago

If it can help you, I have done it for a client. Just add a checkbox in plugin settings, then :

In includes/class-woocomerce-cart-stock-reducer.php : Add : // Define user set variables. $this->show_in_product_pages = $this->get_option( 'expire_countdown' ); if ($this->show_in_product_pages) { add_action( 'woocommerce_check_cart_items', array( $this, 'check_cart_items' ), 9 ); add_action( 'woocommerce_before_shop_loop', array( $this, 'check_cart_items' ), 9 ); }