Skip to content

Instantly share code, notes, and snippets.

@digitalchild
Last active March 3, 2017 21:59
Show Gist options
  • Save digitalchild/d3190ab2f72575057b7e7b46a6cb4891 to your computer and use it in GitHub Desktop.
Save digitalchild/d3190ab2f72575057b7e7b46a6cb4891 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