• Resolved panda

    (@alejorostata)


    I tried adding the Wishlist from WooCommerce My-Account Endpoint using the following code in my functions.php.

    <?php
    function add_wc_endpoint_rewrite() {
        add_rewrite_endpoint( 'wishlist', EP_ROOT | EP_PAGES );
    }
    add_action( 'init', 'add_wc_endpoint_rewrite' );
    //2  
    function wc_endpoint_query_vars( $vars ) {
        $vars[] = 'wishlist';
        return $vars;
    }
    add_filter( 'query_vars', 'wc_endpoint_query_vars', 0 );
    //3
    function add_wc_endpoint_title( $items ) {
        $items[ 'wishlist' ] = 'Wishlist';
        return $items;
    }
    add_filter( 'woocommerce_account_menu_items', 'add_wc_endpoint_title' );
    //4
    function wishlist_content() {
        echo do_shortcode( '[ti_wishlistsview]' );
    }
    //5
    add_action( 'woocommerce_account_wishlist_endpoint', 'wishlist_content' );
    ?>

    It’s all working fine except when there are more than 10 items on Wishlist. The Next Page button is not working, it does reloading the page but it doesn’t show the next items.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author templateinvaders

    (@templateinvaders)

    Hi @alejorostata

    The issue happened because you need to add rewrite rules for pagination on your endpoint.
    Wishlist query using wl_paged variable for the number of page to adjust wishlist products query.

    Thread Starter panda

    (@alejorostata)

    Please enlighten me on how to do that. How can I add rewrite rules for pagination?

    Plugin Support Stan

    (@stantinv)

    Hi @alejorostata,

    It’s not an easy task that can be achieved with a few strings of code and it requires customization. Since you’ve already added the endpoint at My Account, we’ve provided a tip on how to proceed further.

    Thanks for undertsanding,
    Stan

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Next Page button not working after adding the Wishlist in My-Account End-Point’ is closed to new replies.