Skip to content

Instantly share code, notes, and snippets.

@jrick1229
Last active September 15, 2019 21:53
Show Gist options
  • Save jrick1229/1613fbba5f4c7da58ac5ad1160b28d67 to your computer and use it in GitHub Desktop.
Save jrick1229/1613fbba5f4c7da58ac5ad1160b28d67 to your computer and use it in GitHub Desktop.
Create a notice on the Payment Methods section of the My Account page. Works best for instructing customers that changing the 'Default method' will NOT change any active subscriptions without also checking the checkbox.
<?php
function notice__before_payment_methods( $has_methods ) {
wc_print_notice( __( 'In order to effectively change the payment method on ALL of your subscriptions, you must check the checkbox on the next page after clicking \'Add payment method\'.<br><br>You can also change the payment method on ONE subscription by visiting the individual subscription in the \'Subscriptions\' tab. More info can be found <a href="https://docs.woocommerce.com/document/subscriptions/customers-view/#section-11">here</a>.', 'woocommerce' ), 'notice' );
};
add_action( 'woocommerce_before_account_payment_methods', 'notice__before_payment_methods', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment