Support » Plugin: YITH WooCommerce Wishlist » How to add an "Add to Wishlist" button in my page?

  • Resolved daz1uk


    Hi all,

    I’m trying to add an “Add to Wishlist” button next to my “Add to Cart” button on my products page, so far I’ve tried adding this with a function with no joy:

    function add_wishlist_button() {
    echo ‘<button type=”submit”><span>’ . do_shortcode(‘[yith_wcwl_add_to_wishlist]’) . ‘</span>Add to wishlist</button>’;

    Can the “woocommerce_after_add_to_cart_button” action be used for this purpose, I can’t find any real detail on this action anywhere. If I’m way off course, how can I achieve what I’m trying to do?

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


    Hi daz1uk

    I see that this topic is marked as solved
    If you still need support, I can suggest to add this line of code at the end of functions.php file of your theme

    if( defined( 'YITH_WCWL' ) && ! function_exists( 'yith_wcwl_add_wishlist_on_loop' ) ) {
    	function yith_wcwl_add_wishlist_on_loop() {
    		echo do_shortcode( '[yith_wcwl_add_to_wishlist]' );
    	add_action( 'woocommerce_after_shop_loop_item', 'yith_wcwl_add_wishlist_on_loop', 15 );

    Please, let me know
    Have a nice day

    I would like to add the Wishlist to the Cart page, either next to the delete ‘X’ or before Quantity. Is there code that will work for that?

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add an "Add to Wishlist" button in my page?’ is closed to new replies.