Hi @tanino11
Thanks for reaching out!
I understand that you want to hide the Payment
and Cancel Order
buttons under the My Accounts
page, is that correct?
These buttons are automatically shown for orders having the status: Pending Payment
.
I believe this could be handled via custom CSS, but I just want to make sure of your end goal here or what are you trying to achieve so that we could point you in the right direction.
Thanks!
Yes, that’s right! I want to hide them.
Thanks for reply
Hi @tanino11
Thanks for providing more context to your inquiry here.
I did some research and found the code below from this thread worked on my site:
add_filter('woocommerce_my_account_my_orders_actions', 'remove_myaccount_orders_cancel_button', 10, 2);
function remove_myaccount_orders_cancel_button( $actions, $order ){
unset($actions['cancel']);
return $actions;
}
You could also add unset($actions['cancel']);
to hide the Pay
button.
Output:

Image Link: https://snipboard.io/qaG6xS.jpg
Hope this helps!
You’re welcome! @ddvillavicencio I’m glad to hear that the issue has been resolved. If you require any further assistance or have any additional questions in the future, please feel free to create a new ticket, and we’ll be happy to help you out.
Have a great day!