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:
parent
80b6c0f541
commit
170737b4e8
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue