Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Add Button to My Account page (Woo)?

  • Hello,

    I’d like to add a button below the default content of the my-account page in WooCommerce, like on this screenshot.

    I have created a Block-Element with a button, display on my-account-page and hook after_account_navigation, but the button will be displayed above the default-content on the my-account-dashboard.

    How can I add a button like on the screenshot above?

    Thank you in advance and kind regards,
    Sascha

  • Hi there,

    can i see the account page ?

  • Sure, you can access the page here.

    Also, in case you need admin-login, you find the auto-login-ling in the private note field below

  • Hi there,

    This wouldn’t be something the theme can control as the WooCommerce hook is coming from WooCommerce templates.

    Looking at the visual guide here: https://www.businessbloomer.com/woocommerce-visual-hook-guide-account-pages/

    Perhaps the woocommerce_account_dashboard hook would be what you are looking for?

  • Thanks Leo, makes sense, although I don’t understand fully about how to hook a button to woocommerce_account_dashboard. I cannot add this hook in Elements, correct? Is so, can you recommend on another method to place a GB-Button there?

  • Solved:

    I have just added this code to the functions.php and styled the button via CSS:

    function woo_custom_button_myaccount01() {
       echo '<a class="woo_custom_button_myaccount01" href="#courses">Access your courses</a>';
    }
    add_action( 'woocommerce_account_dashboard', 'woo_custom_button_myaccount01' );

    Happy easter 🙂

  • although I don’t understand fully about how to hook a button to woocommerce_account_dashboard. I cannot add this hook in Elements, correct?

    You absolutely can! I believe this is what you are looking for:
    https://docs.generatepress.com/article/block-element-hook/#custom-hook

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.