When declaring an action in a class, we use this:
class the_class{
function __construct(){
add_action( 'the_action', array( $this, 'cb_function' ) );
}
function cb_function(){
}
}
We are trying to declare a remove action in a class, we are trying this:
class the_class{
function __construct(){
remove_action( 'woocommerce_after_shop_loop_item', array( $this, 'woocommerce_template_loop_add_to_cart' ) );
remove_action( 'woocommerce_single_product_summary', array( $this, 'woocommerce_template_single_add_to_cart' ), 30 );
}
}
But it is not working, what is wrong?