Skip to content

Instantly share code, notes, and snippets.

@fervous
Forked from digitalchild/functions.php
Created March 3, 2017 21:59
Show Gist options
  • Save fervous/38bcda128c0a6c8745bbf8efc3ebd548 to your computer and use it in GitHub Desktop.
Save fervous/38bcda128c0a6c8745bbf8efc3ebd548 to your computer and use it in GitHub Desktop.
Display a notice if the vendor hasn't connected their stripe account
<?php
// Add this to your themes functions.php this will not work with free only the pro dashboard.
add_action( 'wcv_pro_before_dashboard', 'add_stripe_notice' );
function add_stripe_notice( ){
$stripe_token = get_user_meta( get_current_user_id(), '_stripe_connect_access_key' , true );
if ( ! isset( $stripe_token ) ){
echo '<div class="woocommerce-error"><p>Connect your stripe account to accept payments thanks!</p></div>';
}
} // add_stripe_notice()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment