• laudag

    (@laudag)


    Hi,
    I just made a new version of an old website where I was using YITH woocommerce badgfe manager free. It was perfect. But in the news web site, I’m using Divi, and the theme builder of Divi. The badge show up un the categories lists, but not in the product pages made with a templte in the divi theme builder. Your plugin is not compatiple ?

    Thanks.
    Laurent

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Iván Sosa

    (@ivansosa)

    Hi there,

    hope you are doing well! ??

    Please, try to add this custom code in the functions.php of your theme:

    if ( !function_exists( 'yith_wcbm_customization_badge_container_start' ) && !function_exists( 'yith_wcbm_customization_badge_container_end' ) ) {
       add_action( 'woocommerce_before_single_product_summary', 'yith_wcbm_customization_badge_container_start', 15 );
       add_action( 'woocommerce_before_single_product_summary', 'yith_wcbm_customization_badge_container_end', 25 );
    
       function yith_wcbm_customization_badge_container_start() {
           do_action( 'yith_wcbm_theme_badge_container_start' );
       }
    
       function yith_wcbm_customization_badge_container_end() {
           do_action( 'yith_wcbm_theme_badge_container_end' );
       }
    }

    Let us know if that did the trick.

    Have a nice day!

    Thread Starter laudag

    (@laudag)

    Woaw ! Almost perfect ! Thanks ! The badge is displayed on the page, but on the upper left corner of the main container instead of on the upper left corner of the image. But I guess it’s hard, even with CCS, to do that.
    At least, I would try to display it in CSSin the image and text zone of the product, above the title of the product for example, but the code of the badge is outside of this code zone, so it seems I can’t place it inside this zone image/text of the woocommerce product.
    May be an idea ?

    https://www.immobilier-dage.com/immobilier/villes/auriol/maison-de-150-m%c2%b2/

    Plugin Support Iván Sosa

    (@ivansosa)

    Hi there,

    it’s difficult because it’s using his own gallery with different hooks.
    Maybe you could try to use this custom code in the functions.php to look better.

    It should move the badge to the image section.

    if ( ! function_exists( 'yith_wcbm_badges_position' ) ) {
    	function yith_wcbm_badges_position() {
    		$js = "
            jQuery( function() {
                jQuery( '#main-content .yith-wcbm-badge' ).prependTo( '.wcgs-carousel .slick-list' );
            });
            ";
    		wp_add_inline_script( 'woocommerce', $js );
    	}
    	add_action( 'wp_enqueue_scripts', 'yith_wcbm_badges_position', 99 );
    }

    Have a great day!

    Thread Starter laudag

    (@laudag)

    Thanks for taking time for my problem. But… This second hack doesn’t work. Not even a YITH div showing up in the source code.

    Plugin Support crodriguez1991

    (@crodriguez1991)

    Hello there,

    Thanks for contacting us and I hope you’re doing well :D.

    I tried to applied the code directly in the browser console and seems the badge was moved near to the image.

    In order to add it inside the image, it’s necessary to use the default WordPress and WooCommerce hooks.

    Unfortunately I don’t have a copy of Divi theme so you should ask developers that help you to put the badge inside the image.

    I hope it helps you.

    Have a good day.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Badge not showing in a Divi theme buider page’ is closed to new replies.