Skip to content

Commit

Permalink
fix: seller metabox rendering issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbir1991 committed Jan 21, 2020
1 parent 02c7b8d commit 3728426
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 11 additions & 0 deletions depricated/depricated-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,14 @@ function dokan_depricated_widget_classes() {
}

add_action( 'woocommerce_before_main_content', 'dokan_depricated_widget_classes' );

/**
* Depricated function for render seller metabox in product
*
* @param object $post
*
* @return void|html
*/
function dokan_seller_meta_box( $post ) {
\WeDevs\Dokan\Admin\Hooks::seller_meta_box_content( $post );
}
6 changes: 2 additions & 4 deletions includes/Admin/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public function send_notification_on_product_publish( $post ) {
*/
public function add_seller_meta_box(){
remove_meta_box( 'authordiv', 'product', 'core' );
add_meta_box( 'sellerdiv', __( 'Vendor', 'dokan-lite' ), [ $this, 'seller_meta_box_content' ], 'product', 'normal', 'core' );
add_meta_box( 'sellerdiv', __( 'Vendor', 'dokan-lite' ), [ self::class, 'seller_meta_box_content' ], 'product', 'normal', 'core' );
}

/**
Expand All @@ -373,14 +373,12 @@ public function add_seller_meta_box(){
*
* @param object $post
*/
public function seller_meta_box_content( $post ) {
public static function seller_meta_box_content( $post ) {
global $user_ID;

$admin_user = get_user_by( 'id', $user_ID );
$selected = empty( $post->ID ) ? $user_ID : $post->post_author;
$vendors = dokan()->vendor->all( [ 'number' => -1, 'role__in' => [ 'seller' ] ] );

// $sellers = $user_query->get_results();
?>
<label class="screen-reader-text" for="dokan_product_author_override"><?php esc_html_e( 'Vendor', 'dokan-lite' ); ?></label>
<select name="dokan_product_author_override" id="dokan_product_author_override" class="">
Expand Down

0 comments on commit 3728426

Please sign in to comment.