Support » Plugin: TI WooCommerce Wishlist » Customize Wishlist Page URL

  • Resolved MisterR

    (@mister_r)


    Hello!

    Is there a way to customize the Wishlist page URL?

    In our case it has to be domain.com/account/wishlist,

    where “account” is the “My Account” page slug,
    and “wishlist” is a custom endpoint added in functions.php

    Redeclaring “tinv_get_option” function could be a solution, but unfortunately its declaration is added on “plugins_loaded” event, which happens before theme files are loaded.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Stan

    (@stantinv)

    Hi @mister_r,

    1. The main issue is that the Wshlist page has form submit handler and it should be a separate page but not an endpoint to work properly. We have an idea to add endpoints in future plugin updates but unfortunately it’s still not clear how to use this feature for guests.

    2. The mentioned above function doesn’t relate to this case. It’s just a simple function wrapper to get option value.

    3. As a temporary solution you can add the Wishlist page as a child page of your My Account page. Should be good.

    Regards,
    Stan

    Plugin Support Stan

    (@stantinv)

    We are now closing this topic and mark it as resolved due to inactivity. If the issue remains please, fill free to re-open it at any time.

    Thread Starter MisterR

    (@mister_r)

    Hi @stan,

    Yes, thank you for the explanation. The client agreed to move wishlist to a regular page. So the issue is fixed.

    But I hope you’ll add the ability to place the [ti_wishlistsview] shortcode on “My Account” endpoints in the near future.

    Andrea Veglia

    (@andrea0veglia)

    // Pagina Wishlist (CUSTOM)//
    
    /*
     * Step 1. Add Link to My Account menu
     */
    add_filter ( 'woocommerce_account_menu_items', 'wish_link', 40 );
    function wish_link( $menu_links ){
        
        $menu_links = array_slice( $menu_links, 0, 5, true )
        + array( 'wishlist' => 'Whishlist' )
        + array_slice( $menu_links, 5, NULL, true );
        
        return $menu_links;
        
    }
    /*
     * Step 2. Register Permalink Endpoint
     */
    add_action( 'init', 'wish_add_endpoint' );
    function wish_add_endpoint() {
        
        // WP_Rewrite is my Achilles' heel, so please do not ask me for detailed explanation
        add_rewrite_endpoint( 'wishlist', EP_PAGES );
        
    }
    /*
     * Step 3. Content for the new page in My Account, woocommerce_account_{ENDPOINT NAME}_endpoint
     */
    add_action( 'woocommerce_account_wishlist_endpoint', 'wishlist_my_account_endpoint_content' );
    function wishlist_my_account_endpoint_content() {
        
        echo  do_shortcode('[ti_wishlistsview]') ;
        
                
            }

    Try with this for add the shortcode in “my account” page. You have to insert it in funtion.php

    Thread Starter MisterR

    (@mister_r)

    @andrea0veglia,

    Your code simply adds a new endpoint to the My Account page.

    It’s not even close to the issue described in the heading message.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Customize Wishlist Page URL’ is closed to new replies.