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

    (@yithemes)

    Hi prosarmientolou,

    this is really a big change, and it will require some custom js handling

    jQuery(document).ready(function($){
        $('body').on( 'added_to_wishlist', function(){
            var el_wrap = $('.yith-wcwl-add-to-wishlist'),
                add_button = el_wrap.find('[data-product-id]'),
                product_id = add_button.data('product-id');
    
            el_wrap.before( $('<a>').attr('href', '?remove_from_wishlist=' + product_id).html( 'Remove from wishlist').addClass('button') );
            el_wrap.remove();
        } )
    });

    Besides, you will need to overwrite the template add-to-wishlist.php, simply copying it on your theme’s root; then, you should change .yith-wcwl-wishlistexistsbrowse div to show a link to remove from wishlist, like this:

    <div class="yith-wcwl-wishlistexistsbrowse <?php echo ( $exists && ! $available_multi_wishlist ) ? 'show' : 'hide' ?>" style="display:<?php echo ( $exists && ! $available_multi_wishlist ) ? 'block' : 'none' ?>">
        <a href="?remove_from_wishlist=<?php echo $product_id ?>" class="button">
            <?php _e( 'Remove from wishlist', 'yit' ) ?>
        </a>
    </div>

    Let me know if this helps
    Have a nice day ??

    Thread Starter prosarmientolou

    (@prosarmientolou)

    Hi!

    That works fine, but what I wanted is here https://ssproducer.com/doughboy/best-above-ground-pools-manufacturer/pick-your-pool, when you click the heart it will add the product to wishlist, then the remove from wishlist appear without needing to refresh.

    And for the remove from wishlist button it will remove the product from wishlist like in the wishlist page again without refreshing and then again it will display the add to wishlist button.

    This is a lot but hopefully you can give me a solution.

    I hope this will be an option in your next update.

    Thanks a lot!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove from Wishlist button’ is closed to new replies.