Hi there!
Thank you for providing the detailed error messages regarding the issue customers face when trying to add a payment method on their account page.
The warning you’re seeing usually appears when the code is trying to access data (like a form field or array element) that doesn’t exist or is null. In this context, it seems to be related to the “Add Payment Method” functionality in the My Account > Payment Methods section.
To assist you better, I’d like to understand your site properly. Please share with us the necessary information below for us to investigate the issue further:
- System Status Report which you can find via WooCommerce > Status
- Fatal error logs (if any) under WooCommerce > Status > Logs.
Please use https://pastebin.com/ or https://gist.github.com/ and share a link to that paste in reply here. Once we have more information, we’ll be able to assist you further
If you’d prefer to remove the “Payment Methods” section from the My Account page entirely, you can do so with a code snippet like this:
add_filter( 'woocommerce_account_menu_items', 'remove_payment_methods_my_account', 999 );
function remove_payment_methods_my_account( $items ) {
unset( $items['payment-methods'] );
return $items;
}
You can add this snippet to your child theme’s functions.php file or via a plugin like Code Snippets. Please note that generally we do not provide support for customizations. If that doesn’t help, you can ask your development questions in the WooCommerce Community Slack as custom code falls outside our usual scope of support.
Hi there,
It’s been a little while since we last heard from you, so I’ll mark this as resolved. Reach out anytime if you’d like to revisit this!
Apart from this, if you’re happy with our plugin and the support you’ve received, we’d really appreciate a review: https://wordpress.org/support/plugin/woocommerce/reviews/#new-post
Yes, thanks solved and also left a review. Many thanks!!!
Hi @neverendlessly,
Thank you for the kind words — I’m really glad to hear the support you’ve received here has been helpful.
If you ever run into any other Woo-related issues, don’t hesitate to start a new topic. We’ll be happy to help!