• Resolved behaminhome

    (@behaminhome)


    Hi there,

    I am currently using Storefront theme on Woocommerce.

    YITH WOOCOMMERCE WISHLIST plugin is working smoothly in store and product pages but not in the homepage. It might be because of I am using Woocommerce widgets to show products on homepage.

    Can you please help me to fix this problem?

    Thank you in advance!
    Nurseli

    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 can see that you’re using WC Gutenberg blocks in your homepage; currently we don’t offer official support to these widgets since WooCommerce doesn’t include proper hooks to reliably append content to items content

    Anyway, maybe you could try with the following snippet of code: it will append Add to Wishlist button at the end of each item of the block
    All you have to do is to copy the snippet and paste it at the end of functions.php file of your theme or child theme

    if ( ! function_exists( 'yith_wcwl_append_add_to_wishlist_to_blocks' ) ) {
    	function yith_wcwl_append_add_to_wishlist_to_blocks( $item, $data, $product ) {
    		$add_to_wishlist = do_shortcode( '[yith_wcwl_add_to_wishlist product_id="' . $product->get_id() . '"]' );
    
    		$item = str_replace( '</li>', $add_to_wishlist . '</li>', $item );
    
    		return $item;
    	}
    	add_filter( 'woocommerce_blocks_product_grid_item_html', 'yith_wcwl_append_add_to_wishlist_to_blocks', 10, 3 );
    }
    

    Here an example of result, in my local installation

    Thread Starter behaminhome

    (@behaminhome)

    Hi again

    Thank you for your helping, that code works!

    Plugin Author YITHEMES

    (@yithemes)

    You’re welcome

    If you enjoy our plugin, don’t forget to leave us a 5 star review, to support us and help our work
    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Favourite Button is not show in homepage’ is closed to new replies.