• Hey,
    I want a particular dokan vendor to see only his own orders instead of seeing everyone else’s.
    Yes, I acknowledge that dokan vendors can’t see each other’s orders but they can at least see the order name in the list.
    How can I make it so that only vendors can see only see their own orders?
    If you can’t help then at least tell me how can I can hide other vendor orders By using the “IF” statement in the child theme.

    • This topic was modified 3 years, 8 months ago by shubhamtemak.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Vladimir Garagulya

    (@shinephp)

    Hi,

    If Dokan vendor order is a custom post type, it should have the author_id field, like any other post. So compare this field value with current user ID, like below

    
    $current_user = wp_get_current_user();
    if ( $order->author_id!==$current_user->ID ) {
        echo 'You can not see orders of other vendors';
    

    In code above I suppose that $order variable contains WP_Post object initialized by the dokan vendor order database record.

    Thread Starter shubhamtemak

    (@shubhamtemak)

    Thanks, but can I use it as a filter and put it in the child theme?

    Plugin Author Vladimir Garagulya

    (@shinephp)

    You can, but you have to know what filter to use for it, or modify some .php file from parent theme, responsible for orders output.

    Thread Starter shubhamtemak

    (@shubhamtemak)

    Okay, can you make this filter or dev is needed here?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Dokan vendor specific role’ is closed to new replies.