From 170737b4e8f1f9e8dfa861ac895e768644cd57d9 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 20 Aug 2015 23:43:39 +0100 Subject: [PATCH] Remove purchasable check completely Not required as the cart class checks this later on. Was originally added for #7220. Later changed to support admin buying private products https://github.com/woothemes/woocommerce/commit/9ed36d4b0104e77ede338862 b67a99d0a243aac8 Fixes #8908 --- includes/class-wc-form-handler.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/includes/class-wc-form-handler.php b/includes/class-wc-form-handler.php index 322ee7815ca..ad18a28d4e2 100644 --- a/includes/class-wc-form-handler.php +++ b/includes/class-wc-form-handler.php @@ -582,12 +582,6 @@ class WC_Form_Handler { $adding_to_cart = wc_get_product( $product_id ); $add_to_cart_handler = apply_filters( 'woocommerce_add_to_cart_handler', $adding_to_cart->product_type, $adding_to_cart ); - // Check if the product is published/available - if ( ! $adding_to_cart->is_purchasable() ) { - wc_add_notice( __( 'Sorry, this product is unavailable.', 'woocommerce' ), 'error' ); - return; - } - // Variable product handling if ( 'variable' === $add_to_cart_handler ) { $was_added_to_cart = self::add_to_cart_handler_variable( $product_id );