• HI there, we just installed YITH wish list. Whenever we select My Account as main wishlist page, WooCommerce My Account page not working properly. The details at My Account not shown but only the end point which is only titles shown eg. Dashboard, Account Details, Order etc, and not able to logout from WooCommerce My Account page too as customer role. Need your professional advice. Thanks

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support Pablo Pérez

    (@pperez001)

    Hi there,

    In order to add the wishlist page as an endpoint, please remove the My account page as your main wishlist page and also remove the shortcode. Then, add the following code in your functions.php of your theme:

    if (class_exists('YITH_WCWL')) { // WISHLIST - a?adir endpoint en my account page
        if (!function_exists('yith_wcwl_add_endpoint_my_account')) {
            function yith_wcwl_add_endpoint_my_account($items)
            {
    
                // Insert your custom endpoint.
                $items['my-wishlist'] = 'My Wishlist';
    
                return apply_filters('yith_wcwl_account_menu_item', $items);
            }
    
            add_filter('woocommerce_account_menu_items', 'yith_wcwl_add_endpoint_my_account');
        }
    
        if (!function_exists('yith_wcwl_add_wishlist_endpoint')) {
            function yith_wcwl_add_wishlist_endpoint()
            {
                echo do_shortcode('[yith_wcwl_wishlist]');
            }
    
            add_action('woocommerce_account_my-wishlist_endpoint', 'yith_wcwl_add_wishlist_endpoint');
        }
    
        if (!function_exists('yith_wcwl_add_endpoints')) {
    
            function yith_wcwl_add_endpoints()
            {
                add_rewrite_endpoint('my-wishlist', EP_ROOT | EP_PAGES);
            }
    
            add_action('init', 'yith_wcwl_add_endpoints');
        }
    }

    Let us know if this code could help you.

    Thread Starter hooiling

    (@hooiling)

    Hi Pablo,

    Thanks for your reply. Sorry, I am new to this. Did I need Astra pro version for the functions.php you suggested?

    Plugin Support Juan Coronel

    (@juaancmendez)

    Hello there,

    You can add it from the file editor of your theme, or if you don’t have one, I recommend contacting your theme support to see how to add personalized codes. You can also use plugins to add codes like for example Code Snippets.

    Let us know any news.

    Best regards.

    Thread Starter hooiling

    (@hooiling)

    Hi Juan,

    Thanks for your reply. We have inserted the codes at Code Snippets, however nothing happened. Thanks.

    Best regards, Suan

    Plugin Support Pablo Pérez

    (@pperez001)

    Hi,

    Please, try with the following code using if you are using Code Snippets:

    if (!function_exists('yith_wcwl_add_endpoint_my_account')) {
        function yith_wcwl_add_endpoint_my_account($items)
        {
    
                // Insert your custom endpoint.
            $items['my-wishlist'] = 'My Wishlist';
    
            return apply_filters('yith_wcwl_account_menu_item', $items);
        }
    
        add_filter('woocommerce_account_menu_items', 'yith_wcwl_add_endpoint_my_account');
    }
    
    if (!function_exists('yith_wcwl_add_wishlist_endpoint')) {
        function yith_wcwl_add_wishlist_endpoint()
        {
            echo do_shortcode('[yith_wcwl_wishlist]');
    	}
    
        add_action('woocommerce_account_my-wishlist_endpoint', 'yith_wcwl_add_wishlist_endpoint');
    }
    
    if (!function_exists('yith_wcwl_add_endpoints')) {
    
        function yith_wcwl_add_endpoints()
        {
            add_rewrite_endpoint('my-wishlist', EP_ROOT | EP_PAGES);
        }
    
        add_action('init', 'yith_wcwl_add_endpoints');
    }

    Let us know if this code could help you.

    Thread Starter hooiling

    (@hooiling)

    hi Pablo,

    Thanks for reply. It’s still the same. I have tried on Code Snippets and Snippets, nothing shown on My Account page. Thanks.

    Best regards, Suan

    Plugin Support Juan Coronel

    (@juaancmendez)

    Hello Suan,

    I just tested the code that my colleague provided you in the Code Snippets plugin and it works correctly. Try putting it as priority 99.

    If it still doesn’t work, I recommend performing the following tests to see if there is any conflict with your theme/plugins:

    • update the plugin, WC and WP to the latest version.
    • change to a default WP theme like 2023.
    • Leave only WC, our plugin and Code Snippets active, and activate your plugins in batches until you find the one that conflicts.

    Let us know any news.

    Best regards.

    Thread Starter hooiling

    (@hooiling)

    Hi Juan,

    Thanks for your reply. Yes, it’s works! It was due to we copy the codes from email and there were errors shown (e.g. line 8 error…). This is solved after we copied direct from here ??

    However, when we select My Wishlist from My Account Page, it shown ” This page doesn’t seem to exist.” We have double checked the My Wishlist page and it is published.

    Btw, My Wishlist at My Account Page appear at the bottom after Logout. Wonder if it can be repositioned before Log out.

    Thanks for the awesome plugin and service.

    Best regards, Hooi Ling

    Plugin Support Juan Coronel

    (@juaancmendez)

    Hi Hooi Ling,
    thanks for your words!

    Try replacing the previous code with this new one:

        if (!function_exists('yith_wcwl_add_endpoint_my_account')) {
            function yith_wcwl_add_endpoint_my_account($items)
            {
                $logout = $items['customer-logout'];
                unset($items['customer-logout']);
    
                // Insert your custom endpoint.
                $items['my-wishlist'] = 'My Wishlist';
    
                // Insert back the logout item.
                $items['customer-logout'] = $logout;
    
                return apply_filters('yith_wcwl_account_menu_item', $items);
            }
    
            add_filter('woocommerce_account_menu_items', 'yith_wcwl_add_endpoint_my_account');
        }
    
        if (!function_exists('yith_wcwl_add_wishlist_endpoint')) {
            function yith_wcwl_add_wishlist_endpoint()
            {
                echo do_shortcode('[yith_wcwl_wishlist]');
            }
    
            add_action('woocommerce_account_my-wishlist_endpoint', 'yith_wcwl_add_wishlist_endpoint');
        }
    
        if (!function_exists('yith_wcwl_add_endpoints')) {
    
            function yith_wcwl_add_endpoints()
            {
                add_rewrite_endpoint('my-wishlist', EP_ROOT | EP_PAGES);
            }
    
            add_action('init', 'yith_wcwl_add_endpoints');
        }

    If you still do not see the endpoint, please try regenerating the permalinks from Settings > Permalinks > click on Save changes.

    Let us know any news.

    Best regards.

    Thread Starter hooiling

    (@hooiling)

    Hi Juan,

    Thanks so much for your efforts! Everything is working well now, awesome ??

    One final question, would like to check if we can add more ‘Share on’ icons and customize the colours?

    Thanks.

    Best regards, Hooi Ling

    Plugin Support Juan Coronel

    (@juaancmendez)

    Hi Hooi Ling,

    Unfortunately, it is not possible to add new elements in the share options, but you can change the color of the icons by adding the following CSS within Appearance > Customize > Additional CSS:

    .yith-wcwl-share .share-button i {
      color: red;
    }

    Check it out and tell us if it works well for you, please.

    Best regards.

    Thread Starter hooiling

    (@hooiling)

    Hi Juan,

    Well noted with great thanks.

    Wonder if we can change the icon background colour too?

    Thanks so much.

    Best regards, Hooi Ling

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘WooCommerce My Account Page not working when select My Account as main wishlist’ is closed to new replies.