• Hello.

    • I have the wishlist ajax option turned on
    • I’m using the native WooCommerce Product Collection block
    • The block uses ajax to load pages
    • When a new page loaded – it doesn’t have the wishlist button

    How can we solve it?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Support Juan Coronel

    (@juaancmendez)

    Hello there,
    we hope you’re doing well!

    Could you provide us with the link to the page where you have the block and with our active plugin please?

    Let us know any news.

    Best regards.

    Thread Starter asafm7

    (@asafm7)

    Plugin Support Juan Coronel

    (@juaancmendez)

    Hello there,

    I just checked the link provided, and I can see the add to wishlist buttons correctly.

    In case you have active cache on your site, please try clearing it from your site and check again.

    Let us know any news.

    Best regards.

    Thread Starter asafm7

    (@asafm7)

    @juaancmendez

    Please first load another page by clicking “Next Page”:

    https://1drv.ms/i/s!AhEX_VIY1-zfhZtNdbZI7SpTozvaug?e=ixSYdR

    Then, you will see the issue:

    https://1drv.ms/i/s!AhEX_VIY1-zfhZtOsK9fFMDrtkBIHg?e=lfVMK1

    Thanks.

    Thread Starter asafm7

    (@asafm7)

    @juaancmendez

    Any updates on this by any chance?

    Thread Starter asafm7

    (@asafm7)

    @juaancmendez

    Update:

    Finding no solution, I disabled “Enable AJAX loading” option – so you won’t be able to see the issue in the link I previously sent.

    Please try to reproduce it on a test environment:

    • Use the native WooCommerce Product Collection block
    • Make sure you have multiple pages in the block
    • Enable AJAX loading
    • Use the Product Collection block pagination to load new pages
    • You will see the new pages has no “Add to Wishlist” buttons

    Thanks.

    Thread Starter asafm7

    (@asafm7)

    I created a staging website, so you can test the issue there:

    [STAGING] Hobbies 4 Life – Find a hobby for a better life

    Plugin Support Juan Coronel

    (@juaancmendez)

    Hello there,

    Please, try adding the following code in the functions.php file of your active child theme:

    if (!function_exists('yith_wcwl_reload_fragments')) {
        function yith_wcwl_reload_fragments()
        {
            $jquery = 'jQuery(".wp-block-query-pagination a").click(function () {
                setTimeout(function() { 
                    jQuery(document).trigger("yith_wcwl_reload_fragments");
                }, 2000);
            });';
            wp_add_inline_script('jquery-yith-wcwl', $jquery);
            wp_add_inline_script('jquery-yith-wcwl-user', $jquery);
        }
        add_action( 'wp_enqueue_scripts', 'yith_wcwl_reload_fragments', 999 );
    }

    Let us know any news.

    Best regards.

    Thread Starter asafm7

    (@asafm7)

    Thank you, @juaancmendez.

    Yes, it seems to solve the issue.

    Will it be made a part of the plugin?

    Thread Starter asafm7

    (@asafm7)

    @juaancmendez

    After testing a bit more I see it doesn’t work when going back in the pagination,

    Thread Starter asafm7

    (@asafm7)

    @juaancmendez

    Any updates on this by any chance?

    Thanks.

    Plugin Support Juan Coronel

    (@juaancmendez)

    Hello there,

    Try replacing the previous code with this new one:

    if (!function_exists('yith_wcwl_reload_fragments')) {
        function yith_wcwl_reload_fragments()
        {
            $jquery = 'jQuery( document ).on ( "click", ".wp-block-query-pagination-previous, .wp-block-query-pagination-next", function () {
        console.log( "pagination button press" );
        setTimeout(function() {
            jQuery(document).trigger('yith_wcwl_init');
            jQuery(document).trigger('yith_wcwl_reload_fragments');
        }, 1000);
    });';
            wp_add_inline_script('jquery-yith-wcwl', $jquery);
            wp_add_inline_script('jquery-yith-wcwl-user', $jquery);
        }
        add_action( 'wp_enqueue_scripts', 'yith_wcwl_reload_fragments', 999 );
    }

    If you have any caching or script optimizer plugins, disable them temporarily.

    Let us know any news.

    Best regards.

    Thread Starter asafm7

    (@asafm7)

    Thanks, @juaancmendez.

    It is still not working when clicking the “previous” button.

    Is it working for you?

    Thread Starter asafm7

    (@asafm7)

    Hi, @juaancmendez.

    Any update on this by any chance?

    Thanks.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Add to Wishlist button missing from ajax-ly paginated pages’ is closed to new replies.