• Hello,

    I would like to thank you for creating this really cool plugin. Unfortunately, I cannot figure one thing out. The badges are also displaying on all my thumbnails be default, which makes some theme layout totally unusable.

    Check this link.

    There is a sticky add to cart feature which consists of thumbnail image. The badges are also present and I would like to get rid of them here, because it overrides the image and looks bad. I have tried this code suggested in another topic, but I did not work.

    if ( function_exists( 'YITH_WCBM' ) && !empty( YITH_WCBM()->frontend ) ) {
            remove_filter( 'woocommerce_single_product_image_thumbnail_html', array( YITH_WCBM()->frontend, 'show_badge_on_product_thumbnail' ), 99 );
    }

    (added via code snippets plugin)

    The div class of this layout is:
    shoptimizer-sticky-add-to-cart__content

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi there,

    I think the issue is the snippet plugin. Try to use this code instead:

    if( ! function_exists( 'yith_remove_badge_single_product_image_thumbnail' ) ){
    	function yith_remove_badge_single_product_image_thumbnail(){
    		if ( function_exists( 'YITH_WCBM' ) && !empty( YITH_WCBM()->frontend ) ) {
    			remove_filter( 'woocommerce_single_product_image_thumbnail_html', array( YITH_WCBM()->frontend, 'show_badge_on_product_thumbnail' ), 99 );
    		}
    	}
    	add_action( 'init', 'yith_remove_badge_single_product_image_thumbnail' );
    }

    Let us if works on your side or not.

    Thread Starter micwie

    (@micwie)

    Hello.

    I have tried to apply your code through Code Snippets. Unfortunately, it does not work.
    Check the this link to the product page.

    See screenshots here.
    Do you think writing the code directly into the functions will solve this issue or do you have any other idea?

    Thank you!

    Plugin Author YITHEMES

    (@yithemes)

    Hi there,
    yes, sometime it’s necessary the code inside the file functions.php of the theme because Code Snippets section could be loaded too late.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hide badges on all thumbnail images’ is closed to new replies.