Created
September 8, 2015 19:02
-
-
Save anonymous/01261f48dbbe28c53840 to your computer and use it in GitHub Desktop.
Show WC Vendor Custom Fields in front end
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
add_action( 'woocommerce_before_my_account','function_to_show_data'); | |
function function_to_show_data(){ | |
if (current_user_can('vendor')) { | |
$user_id = wp_get_current_user_id(); | |
$vendor_account_name = get_user_meta( $user_id, ‘pv_account_name’ , true); | |
$vendor_account_number = get_user_meta( $user_id, ‘pv_bank_account_number’ , true); ?> | |
<p class="myaccount_user"> | |
<?php | |
_e( 'Hey there!!!!', 'wc_product_vendor' ); | |
_e( 'Your Account Name: '.$vendor_account_name.'</br> Your Account Number: '.$vendor_account_number.'</br>' , 'wc_product_vendor' ); | |
?> | |
</p> | |
<?php } else { | |
_e( 'You don\'t have a vendor account', 'wc_product_vendor' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment