-
sascha
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 -
David
Hi there,
can i see the account page ?
-
sascha
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? -
sascha
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?
-
sascha
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
- You must be logged in to reply to this topic.