Actually, it took me 2 minutes to make that option, so now you have to put it in the next version =P
1. In wc-vendors/classes/admin/settings/sf-options.php
I pasted this under the options for ‘View email addresses’:
$options[ ] = array(
'desc' => __( 'View phone numbers', 'wcvendors' ),
'tip' => __( 'While viewing order details on the frontend, you can disable or enable phone numbers', 'wcvendors' ),
'id' => 'can_view_order_phone',
'type' => 'checkbox',
'std' => true,
);
2. And then back in wc-vendors/classes/front/orders/class-orders.php
first, the top of the form will have this:
function __construct()
{
$this->can_view_orders = WC_Vendors::$pv_options->get_option( 'can_show_orders' );
$this->can_export_csv = WC_Vendors::$pv_options->get_option( 'can_export_csv' );
$this->can_view_emails = WC_Vendors::$pv_options->get_option( 'can_view_order_emails' );
add_action( 'template_redirect', array( $this, 'check_access' ) );
add_action( 'wp', array( $this, 'display_shortcodes' ) );
add_shortcode( 'wcv_orders', array( $this, 'display_product_orders' ) );
}
Change it to this:
function __construct()
{
$this->can_view_orders = WC_Vendors::$pv_options->get_option( 'can_show_orders' );
$this->can_export_csv = WC_Vendors::$pv_options->get_option( 'can_export_csv' );
$this->can_view_emails = WC_Vendors::$pv_options->get_option( 'can_view_order_emails' );
$this->can_view_phone = WC_Vendors::$pv_options->get_option( 'can_view_order_phone' );
add_action( 'template_redirect', array( $this, 'check_access' ) );
add_action( 'wp', array( $this, 'display_shortcodes' ) );
add_shortcode( 'wcv_orders', array( $this, 'display_product_orders' ) );
}
find public function get_headers()
and then under
if ( !$this->can_view_emails ) {
unset( $headers[ 'email' ] );
}
paste this:
if ( !$this->can_view_phone ) {
unset( $headers[ 'phone' ] );
}
and finally at public function format_order_details( $orders, $product_id )
under
if ( !$this->can_view_emails ) {
unset( $body[ $i ][ 'email' ] );
}
paste this:
if ( !$this->can_view_phone ) {
unset( $body[ $i ][ 'phone' ] );
}
**Just a note, you have to actually go back to the WC Vendors->Capabilities settings and save them before they take effect
And there you go. Now you have the option to enable or disable vendors from seeing customers’ phone numbers in order details. The table looks fine and the phone number shows up in the CSV Export as well. I don’t know how to do Github, so I hope someone can do this for me if you decide to use this feature. Thx