BuddyDev

Search

Woocommerce – My Account Short Code in Sub Tab

  • Participant
    Level: Initiated
    Posts: 1
    Isaac Torres on #40351

    Hello, I need support regarding connecting my Woocommerce short-code endpoints via a tab I created.

    In the profile section, I include two custom tabs using the plugin BuddyPress Custom Tab Creator. I labeled the new tabs:

    1. Account
    2. Support

    For the ‘Account’ tab, I created “two” sub tabs. The sub tabs which are labeled:

    1. My Account
    2. Account Settings

    In the “My Account” sub tab, I also included the short-code for the Woocommerce ‘my account’ settings – see screenshot: https://d.pr/i/3muHax. However, the endpoint urls are not connected properly so it is not working on my end when I click Orders, Addresses, etc.

    I reached out to Woocommerce for support regarding connecting my endpoints correctly, however, I was told that they were confident I would be able to receive the proper support by contacting the BuddyPress Custom Tab Creator support team. There point was that without the tabs, the wooocommerce short code would work fine.

    Can you please provide me with steps on how to properly configure my endpoints within the profile?

    Appreciate your help.

    Kind regards,

    Isaac

  • Keymaster
    (BuddyDev Team)
    Posts: 21833
    Brajesh Singh on #40354

    Hi Isaac,

    Welcome to BuddyDev support forums.

    The problem is WooCommerce uses the end point urls relative to your “myaccount” page permalink.

    It does not matter where you put this shortcode, the end point urls are always related to the default WooCommerce my account page. This is due to the way the ‘wc_get_account_endpoint_url’ works. It takes the permalink of ‘myaccount’ page(which is set in your WooCommerce settings) and prepares end point urls relative to them.

    You can check it by putting the shortcode in a normal page or post instead of the profile tab.

    The solution is to filter the specific end point urls to force it point to current page/relative to current page. Profile tabs does not know what kind of content is being used and can not filter this.

    In other words, even if you use the shortcode inside the tab, Profile tab will not be able to change the url for WooCommerec links as they are handles by woo.

    We have a specific plugin to solve this. you can use BuddyCommerce. The plugin is aware of WooCommerec and the related urls and knows how to filter them.

    Please use
    https://wordpress.org/plugins/buddycommerce/

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 1
    Isaac Torres on #40356

    Hi Brajesh,

    Thank you very much for your quick response. I tried the plugin you suggested and I understand the logic of how this works in relation to woocommerce, however, using the plugin requires for me to use the layout as provided by the BuddyCommerce plugin, rather than what I really want: The woocommerce shortcode within the sub tab.

    Is it possible to use the BuddyCommerce plugin to solve my issue while keeping the same layout with the Woocommerce Shortcode?

    Or will this require some sort of custom development to achieve on my end?

    Thank you for your help and time.

    Kind regards,

    Isaac

  • Keymaster
    (BuddyDev Team)
    Posts: 21833
    Brajesh Singh on #40363

    Hi Isaac,
    Thank you.

    There is no our of the box solution to have the WooCommerce tabs to display on the user profile without custom code. You may show the initial state using the shortcode but unless you have someone develop it for you, there will be 2 issues:-

    1. All the links will point to original woocommerce my account page. It can be filtered via code
    2. The form handling(saving card etc), needs to be re-done. Displaying information is a bit easy.

    We faced these issues while creating BuddyCommerce, so noting down.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved