diff --git a/templates/loop/add-to-cart.php b/templates/loop/add-to-cart.php index e018bff6f38..a01cb9ab9b9 100644 --- a/templates/loop/add-to-cart.php +++ b/templates/loop/add-to-cart.php @@ -25,7 +25,9 @@ global $product; 'class' => '' ); - switch ( $product->product_type ) { + $handler = apply_filters( 'woocommerce_add_to_cart_handler', $product->product_type, $product ); + + switch ( $handler ) { case "variable" : $link['url'] = apply_filters( 'variable_add_to_cart_url', get_permalink( $product->id ) ); $link['label'] = apply_filters( 'variable_add_to_cart_text', __( 'Select options', 'woocommerce' ) );