seller_meta_box_content function
-
Hello,
admin with seller cap not showing in product seller field in WP admin dashboard. See “How to reproduce the bug”.
HOW TO REPRODUCE THE BUG
Login with admin account (Admin A)
Create second admin account (Admin B)
Allow this account as “seller”Logout and login with this new account (Admin B)
Create and publish new product in the shop (via woocommerce dahsboard OR Dokan Seller dashboard, no matter)Logout and login with other admin account (Admin A)
Go in WP dashboard
Products > All products
Select the product created by Admin B
Show “author / seller” field
Check the seller select options : Admin B is missing !! You have only Admin A and other seller accounts (with only seller role)END OF HOW TO REPRODUCE THE BUG
Source of issue :
/wp-content/plugins/dokan-lite/includes/Admin/Hooks.php
Line 367public static function seller_meta_box_content
Line 375'role__in' => [ 'seller' ] // ISSUE HERE
Fix : remove line 375 or change it to
'role__in' => [ 'seller', 'administrator' ]
SECOND ISSUE RELATED TO SAME php function
In my website, there is some vendors with same or similar shop name and it’s not easy to know who is who.
Could you please add user name near shop name in seller select option ?
Line 386
change
<option value="<?php echo esc_attr( $vendor->get_id() ); ?>" <?php selected( $selected, $vendor->get_id() ); ?>><?php echo ! empty( $vendor->get_shop_name() ) ? esc_html( $vendor->get_shop_name() ) : esc_html( $vendor->get_name() ); ?></option>
to
<option value="<?php echo esc_attr( $vendor->get_id() ); ?>" <?php selected( $selected, $vendor->get_id() ); ?>><?php echo ! empty( $vendor->get_shop_name() ) ? esc_html( $vendor->get_shop_name() ) . " - " . esc_html( $vendor->get_name() ) : esc_html( $vendor->get_name() ); ?></option>
Before fix :
selection options looked like this :
Shopname1
ShopName 1
Shop Name 1After fix :
Shopname1 – username 1
ShopName 1 – username 4
Shop Name 1 – username 2Thanks for update.
Best regards.
Joffrey
- The topic ‘seller_meta_box_content function’ is closed to new replies.