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
This commit is contained in:
Mike Jolley 2015-08-20 23:43:39 +01:00
parent 80b6c0f541
commit 170737b4e8
1 changed files with 0 additions and 6 deletions

View File

@ -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 );