Home Forums WoodMart support forum Comment out code from child theme

Comment out code from child theme

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #58221

    newsprince
    Participant

    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.

    #58225

    Artem Temos
    Keymaster

    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 );
    #58240

    newsprince
    Participant

    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

    #58247

    Artem Temos
    Keymaster

    We are glad that you sorted it out.

Viewing 4 posts - 1 through 4 (of 4 total)