Home › Forums › WC Vendors Pro Support › Add a new page to pro dashboard next to store, payment and shipping
NOTICE: We've Moved to a Ticket System for Support
As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system. This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.
For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.
If you are a WC Vendors Pro customer please open a support ticket here. If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.
The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.
Thank you to all of our customers!
- This topic has 6 replies, 2 voices, and was last updated 6 years, 10 months ago by Brendon.
-
AuthorPosts
-
June 5, 2017 at 4:18 am #67245BrendonParticipant
Hey support is there a way to add a new tab to the submenu under the settings in pro dashboard I want to display the my account page next to the store tab so users can edit their store and their personal details in the same tabs ideally I would show only the first and last name, email address and password change fields in that page if its possible to provide me that code i would be ecstatic but understand if its not covered by your support 🙂
many thanks again!
June 5, 2017 at 4:28 am #67246BrendonParticipantmay i also please ask what plugin do you guys use for your notifications on this site?
June 5, 2017 at 11:26 pm #67312AnnaMember@mpadmin
Hello,
I can show you how to add a new tab to your dashboard that will lead to the my-account page / edit-account (Account Details page in My Account– which would be the page for the first & last name, email/password..)
This would go in your theme/child theme functions.php (make sure to change the url to your website):/* WC Vendors Pro - Add a new link(s)to the Pro Dashboard */ function new_dashboard_page( $pages ){ $pages[] = array( 'label' => 'My Account', 'slug' => 'https://your-website-here.com/my-account/edit-account/' ); return $pages; } add_filter( 'wcv_pro_dashboard_urls', 'new_dashboard_page' );
The notifications on this site are for buddypress and are built into this theme.
June 6, 2017 at 7:41 pm #67392BrendonParticipantHi Anna, thanks so much but when i add that code to my child theme functions.php file it kills my site and I have to ftp in and remove that code?
June 6, 2017 at 7:57 pm #67400AnnaMember@mpadmin
Yikes! Ok…
Well I just tested it on my dev site and it worked as expected, with a link added to the pro dashboard menu that leads to the my-account page.
Did you add it at the end of the functions.php in your child theme? ( after the opening<?php
)June 6, 2017 at 7:59 pm #67401BrendonParticipant<?php
add_action( ‘wp_enqueue_scripts’, ‘enqueue_parent_styles’ );function enqueue_parent_styles() {
wp_enqueue_style( ‘parent-style’, get_template_directory_uri().’/style.css’ );
}/**
* Replace ‘customer’ role (WooCommerce use by default) with your own one.
**/add_filter(‘woocommerce_new_customer_data’, ‘wc_assign_custom_role’, 10, 1);
function wc_assign_custom_role($args) {
$args[‘role’] = ‘vendor’;return $args;
}
/* This should be placed in your theme/child theme functions.php.
Creates the function for the fields to collect the info, and adds the fields
to the front-end store settings page (payments tab) and the admin user page. */add_action( ‘wcvendors_settings_after_paypal’, ‘store_account_type’ );
function store_account_type( ){
if ( class_exists( ‘WCVendors_Pro’ ) ){
$key = ‘_wcv_custom_settings_account_type’;
$value = get_user_meta( get_current_user_id(), $key, true );
// Account Type
WCVendors_Pro_Form_Helper::input( array(
‘id’ => $key,
‘label’ => __( ‘Account Type’, ‘wcvendors-pro’ ),
‘placeholder’ => __( ‘Savings’, ‘wcvendors-pro’ ),
‘desc_tip’ => ‘true’,
‘description’ => __( ”, ‘wcvendors-pro’ ),
‘type’ => ‘text’,
‘value’ => $value,
)
);
}
}add_action( ‘wcvendors_admin_after_commission_due’, ‘wcv_store_account_type_admin’ );
function wcv_store_account_type_admin( $user ) {
?>
<tr>
<th><label for=”_wcv_custom_settings_account_type”><?php _e( ‘Account Type’, ‘wcvendors-pro’ ); ?></label></th>
<td><input type=”text” name=”_wcv_custom_settings_account_type” id=”_wcv_custom_settings_account_type” value=”<?php echo get_user_meta( $user->ID, ‘_wcv_custom_settings_account_type’, true ); ?>” class=”regular-text”></td>
</tr>
<?php
}
add_action( ‘wcvendors_settings_after_paypal’, ‘store_bank_name’ );
function store_bank_name( ){
if ( class_exists( ‘WCVendors_Pro’ ) ){
$key = ‘_wcv_custom_settings_bank_name’;
$value = get_user_meta( get_current_user_id(), $key, true );
// Bank Name
WCVendors_Pro_Form_Helper::input( array(
‘id’ => $key,
‘label’ => __( ‘Bank Name’, ‘wcvendors-pro’ ),
‘placeholder’ => __( ‘ABSA Bank’, ‘wcvendors-pro’ ),
‘desc_tip’ => ‘true’,
‘description’ => __( ”, ‘wcvendors-pro’ ),
‘type’ => ‘text’,
‘value’ => $value,
)
);
}
}
add_action( ‘wcvendors_admin_after_commission_due’, ‘wcv_store_bank_name_admin’ );
function wcv_store_bank_name_admin( $user ) {
?>
<tr>
<th><label for=”_wcv_custom_settings_bank_name”><?php _e( ‘Bank Name’, ‘wcvendors-pro’ ); ?></label></th>
<td><input type=”text” name=”_wcv_custom_settings_bank_name” id=”_wcv_custom_settings_bank_name” value=”<?php echo get_user_meta( $user->ID, ‘_wcv_custom_settings_bank_name’, true ); ?>” class=”regular-text”></td>
</tr>
<?php
}add_action( ‘wcvendors_settings_after_paypal’, ‘store_account_name’ );
function store_account_name( ){
if ( class_exists( ‘WCVendors_Pro’ ) ){
$key = ‘_wcv_custom_settings_account_name’;
$value = get_user_meta( get_current_user_id(), $key, true );
// Account Name
WCVendors_Pro_Form_Helper::input( array(
‘id’ => $key,
‘label’ => __( ‘Account Name’, ‘wcvendors-pro’ ),
‘placeholder’ => __( ‘Majestic Pet Auctions’, ‘wcvendors-pro’ ),
‘desc_tip’ => ‘true’,
‘description’ => __( ”, ‘wcvendors-pro’ ),
‘type’ => ‘text’,
‘value’ => $value,
)
);
}
}
add_action( ‘wcvendors_admin_after_commission_due’, ‘wcv_store_account_name_admin’ );
function wcv_store_account_name_admin( $user ) {
?>
<tr>
<th><label for=”_wcv_custom_settings_account_name”><?php _e( ‘Account Name’, ‘wcvendors-pro’ ); ?></label></th>
<td><input type=”text” name=”_wcv_custom_settings_account_name” id=”_wcv_custom_settings_account_name” value=”<?php echo get_user_meta( $user->ID, ‘_wcv_custom_settings_account_name’, true ); ?>” class=”regular-text”></td>
</tr>
<?php
}add_action( ‘wcvendors_settings_after_paypal’, ‘store_account_number’ );
function store_account_number( ){
if ( class_exists( ‘WCVendors_Pro’ ) ){
$key = ‘_wcv_custom_settings_account_number’;
$value = get_user_meta( get_current_user_id(), $key, true );
//Account Number
WCVendors_Pro_Form_Helper::input( array(
‘id’ => $key,
‘label’ => __( ‘Account Number’, ‘wcvendors-pro’ ),
‘placeholder’ => __( ‘000-0000-0000’, ‘wcvendors-pro’ ),
‘desc_tip’ => ‘true’,
‘description’ => __( ”, ‘wcvendors-pro’ ),
‘type’ => ‘text’,
‘value’ => $value,
)
);
}
}
add_action( ‘wcvendors_admin_after_commission_due’, ‘wcv_store_account_number_admin’ );
function wcv_store_account_number_admin( $user ) {
?>
<tr>
<th><label for=”_wcv_custom_settings_account_number”><?php _e( ‘Account Number’, ‘wcvendors-pro’ ); ?></label></th>
<td><input type=”text” name=”_wcv_custom_settings_account_number” id=”_wcv_custom_settings_account_number” value=”<?php echo get_user_meta( $user->ID, ‘_wcv_custom_settings_account_number’, true ); ?>” class=”regular-text”></td>
</tr>
<?php
}
add_action( ‘wcvendors_settings_after_paypal’, ‘store_branch_code’ );
function store_branch_code( ){
if ( class_exists( ‘WCVendors_Pro’ ) ){
$key = ‘_wcv_custom_settings_branch_code’;
$value = get_user_meta( get_current_user_id(), $key, true );
//Branch Code
WCVendors_Pro_Form_Helper::input( array(
‘id’ => $key,
‘label’ => __( ‘Branch Code’, ‘wcvendors-pro’ ),
‘placeholder’ => __( ‘000’, ‘wcvendors-pro’ ),
‘desc_tip’ => ‘true’,
‘description’ => __( ”, ‘wcvendors-pro’ ),
‘type’ => ‘text’,
‘value’ => $value,
)
);
}
}
add_action( ‘wcvendors_admin_after_commission_due’, ‘wcv_store_branch_code_admin’ );
function wcv_store_branch_code_admin( $user ) {
?>
<tr>
<th><label for=”_wcv_custom_settings_branch_code”><?php _e( ‘Branch Code’, ‘wcvendors-pro’ ); ?></label></th>
<td><input type=”text” name=”_wcv_custom_settings_branch_code” id=”_wcv_custom_settings_branch_code” value=”<?php echo get_user_meta( $user->ID, ‘_wcv_custom_settings_branch_code’, true ); ?>” class=”regular-text”></td>
</tr>
<?php
}/* WC Vendors Pro – Add a new link(s)to the Pro Dashboard */
function new_dashboard_page( $pages ){
$pages[] = array( ‘label’ => ‘Auction Activity’, ‘slug’ => ‘https://majesticpetauctions.co.za/my-auction-activity/’ );
return $pages;
}
add_filter( ‘wcv_pro_dashboard_urls’, ‘new_dashboard_page’ );
function new_dashboard_page_2( $pages ){
$pages[] = array( ‘label’ => ‘Wishlist’, ‘slug’ => ‘https://majesticpetauctions.co.za/wishlist/’ );
return $pages;
}
add_filter( ‘wcv_pro_dashboard_urls’, ‘new_dashboard_page_3’ );
function new_dashboard_page_3( $pages ){
$pages[] = array( ‘label’ => ‘Vendor Profile’, ‘slug’ => ‘https://majesticpetauctions.co.za/dashboard/settings/’ );
return $pages;
}
add_filter( ‘wcv_pro_dashboard_urls’, ‘new_dashboard_page_3’ );/**
* Minimum Image Size.
**/
add_filter(‘wp_handle_upload_prefilter’,’child_handle_upload_prefilter’);
function child_handle_upload_prefilter($file)
{
$minimum = array(‘width’ => ‘450’, ‘height’ => ‘450’);
$img=getimagesize($file[‘tmp_name’]);
$width= $img[0];
$height =$img[1];
if ($width < $minimum[‘width’] )
return array(“error”=>”Image dimensions are too small. Minimum width is {$minimum[‘width’]}px. Uploaded image width is $width px”);
elseif ($height < $minimum[‘height’])
return array(“error”=>”Image dimensions are too small. Minimum height is {$minimum[‘height’]}px. Uploaded image height is $height px”);
else
return $file;
}
add_filter(‘manage_upload_columns’, ‘child_manage_upload_columns’);
function child_manage_upload_columns($columns) {
$columns[‘dimensions’] = ‘Dimensions’;
return $columns;
}add_action(‘manage_media_custom_column’, ‘child_manage_media_custom_column’, 10, 2);
function child_manage_media_custom_column($column_name, $post_id) {
if( ‘dimensions’ != $column_name || !wp_attachment_is_image($post_id))
return;
list($url, $width, $height) = wp_get_attachment_image_src($post_id, ‘full’);
echo esc_html(“{$width}×{$height}”);
}/* WC Vendors Pro – Add a new link(s)to the Pro Dashboard */
function new_dashboard_page( $pages ){
$pages[] = array( ‘label’ => ‘My Account’, ‘slug’ => ‘https://your-website-here.com/my-account/edit-account/’ );
return $pages;
}
add_filter( ‘wcv_pro_dashboard_urls’, ‘new_dashboard_page’ );June 6, 2017 at 7:59 pm #67402BrendonParticipantThats where Im putting it is that right?
-
AuthorPosts
- The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.