Comment out code from child theme
-
Hello.
Is this possible to comment out or remove this code from inc/woocommerce.php
remove_action( ‘woocommerce_before_shop_loop_item_title’, ‘woocommerce_template_loop_product_thumbnail’, 10 );
add_action( ‘woocommerce_before_shop_loop_item_title’, ‘woodmart_template_loop_product_thumbnail’, 10 );
from the child theme so that it doesn’t overwritten with every new update?
We want the yith badge managment plugin to work.
Thank you.
Hi,
Try to add the following PHP code snippet to the child theme functions.php file to do this
add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );
remove_action( 'woocommerce_before_shop_loop_item_title', 'woodmart_template_loop_product_thumbnail', 10 );
Ok it didn’t work at first but i got it to work with this:
add_action( ‘woocommerce_before_shop_loop_item_title’, ‘woocommerce_template_loop_product_thumbnail’, 9 );
add_action( ‘init’, ‘remove_actions_parent_theme’);
function remove_actions_parent_theme() {
remove_action( ‘woocommerce_before_shop_loop_item_title’, ‘woodmart_template_loop_product_thumbnail’, 10 );
};
Thank you very much
We are glad that you sorted it out.