Created
September 28, 2015 18:24
-
-
Save bentasm1/495fb30da2a848a33b00 to your computer and use it in GitHub Desktop.
Replacement /dashboard/links.php to require Vendor to have a PayPal email set
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This is a replacement /dashboard/links.php file for WC Vendors. It goes in /themes/yourtheme/wc-vendors/dashboard/links.php. It will spit out a message if the vendor does not have a PayPal email set, and not allow them to list products. | |
$wcv_user_id = get_current_user_id(); | |
$wcv_paypal_email = get_user_meta( $wcv_user_id, 'pv_paypal', true ); | |
?> | |
<center> | |
<p> | |
<a href="<?php echo $shop_page; ?>" class="button"><?php echo _e( 'View Your Store', 'wcvendors' ); ?></a> | |
<a href="<?php echo $settings_page; ?>" class="button"><?php echo _e( 'Store Settings', 'wcvendors' ); ?></a> | |
<?php if ( strpos ($wcv_paypal_email, '@') !== false) { | |
if ( $can_submit ) { ?> | |
<a target="_TOP" href="<?php echo $submit_link; ?>" class="button"><?php echo _e( 'Add New Product', 'wcvendors' ); ?></a> | |
<a target="_TOP" href="<?php echo $edit_link; ?>" class="button"><?php echo _e( 'Edit Products', 'wcvendors' ); ?></a> | |
<?php } | |
} else { | |
echo '<br><h3>Before you can list products, you must configure your Store Settings and set your store name and PayPal email address for commissions.</h3>'; | |
} | |
?> | |
</center> | |
<hr> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment