• Resolved Agent 3W

    (@agent3w)


    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 367 public 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 1

    After fix :
    Shopname1 – username 1
    ShopName 1 – username 4
    Shop Name 1 – username 2

    Thanks for update.
    Best regards.
    Joffrey

Viewing 1 replies (of 1 total)
  • Hello @agent3w ,

    Thanks for sharing a detailed report.

    I understand your problem. The first one is related to the fact that Dokan expects that there will be only one admin running the site. If you need a seller account then it is wise to create separate accounts for a second admin and another for the seller. You have got the correct code location. But if there are administrators who are not sellers then their names will also show up which might not be an ideal case for many of our Dokan users.

    I would suggest you to making two separate enhancement request to our Github page – https://github.com/weDevsOfficial/dokan/issues

    The developers will review the request and if there are enough responses hopefully it will be considered in future versions.

    Thank you ??

Viewing 1 replies (of 1 total)
  • The topic ‘seller_meta_box_content function’ is closed to new replies.