Site icon Hip-Hop Website Design and Development

Remove_action does not work

I am using Shopwise theme. In the category pages, the woocommerce shop loop is being used. The template for each product in the list view is retrieved from content-product.php.

Here’s what I added in shopwise/woocommerce/content-product.php:

/**
     * Hook: woocommerce_shop_loop_item_title.
     *
     * @hooked woocommerce_template_loop_product_title - 10
     */
    remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); // doesn't work for some reason.
    do_action( 'woocommerce_shop_loop_item_title' );

I know that this file is being used as the template, because when I try other modifications (i.e. echo ‘this’, or commenting out all of the code), I do see an effect. However, when I add the remove_action line, nothing happens.

For now, I’m using CSS to hide the price on list view, but I want to know why the other approach is not working.