• Resolved Vivek Athalye

    (@vnathalye)


    Hello,

    I’m facing an issue that the Vendor Dashboard > Orders page (vendor-orders.php) is not showing all the expected orders. In my case it should be showing me 2 orders but its showing only 1. I’m not able to find out how $customer_orders variable is populated. Can you please help?

    Other details:
    I’ve 3 users: 1. Admin, 2. Vendor, 3. Customer.

    Both the orders are created by Customer, and have the same product sold by Vendor.

    In wp-admin, when logged in as admin, I can see both the orders. Also, if I directly access */wcmp/vendor-order/orderID URL for the missing order, the order details get displayed. It only the order listing page that’s not showing the order.

    I do have some custom statuses. But both the orders are having same status right now.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter Vivek Athalye

    (@vnathalye)

    Some more info:

    As I understand the Vendor Dashboard > Orders shows only those orders for which commission is created (post_type=’dc_commission’). And these posts are created only when order status is set to either ‘completed’ / ‘processing’. In my earlier scenario I had set the status of one of the two orders to processing manually (temporarily) and that’s why it was getting listed. But for other order I did not change the status and hence it was not getting listed.

    Now here is my requirement:

    When a new order is created, based on some conditions I set the order status to my-custom-sts (kind of on-hold, the customer hasn’t paid yet). At this time vendor must get notified and needs to take some action on the order. At this time I don’t want to calculate the commission as such because the customer hasn’t paid yet. But still the order should get listed on Vendor Dashboard.

    How do I achieve this?

    Thread Starter Vivek Athalye

    (@vnathalye)

    There is one table wp_wcmp_vendor_orders that has information like order_id, vendor_id, commission_id and other details. Why not use this to fetch the orders of a vendor?

    @vnathalye The default flow of WC Marketplace will only show the order in the dashboard only when the order status is Processing or Completed.

    Now, as soon as the order status becomes Processing or Completed, the commission gets generated and the vendor also receives New Order email.

    Now, you can change the flow as per your requirement (i.e. display of the order in the dashboard, even though the customer has not paid for it ), for that, you may refer to our GitHub to have an idea how are we displaying the order in the dashboard – https://github.com/dualcube/dc-woocommerce-multi-vendor/blob/master/classes/class-wcmp-vendor-order-page.php.

    Let us know if you have any further query.

    Thread Starter Vivek Athalye

    (@vnathalye)

    I’m not sure if I understand you correctly.

    The link that you shared (class WCMp_Vendor_Order_Page) has following code that gets the orders to display. (https://github.com/dualcube/dc-woocommerce-multi-vendor/blob/master/classes/class-wcmp-vendor-order-page.php#L204-L209)

            $vendor_orders_array = $vendor->get_orders();
            if (!$vendor_orders_array)
                $vendor_orders_array = array();
            $_orders = array_unique($vendor_orders_array);
            if (!empty($_orders)) {
    

    I’m not seeing any filter that I can hook into to modify the orders that are used. Nor could I find any such hook inside $vendor->get_orders().

    So are you suggesting me to modify the code in this file as per my needs? I guess that will be a really bad idea from maintenance perspective. Isn’t it?

    If you are suggesting something else, can you please elaborate (with specific code samples / references)?

    Hi @vnathalye, I have forwarded this to our development team, so they can assist you better with the hook and filter you may use for this.

    As soon as I hear from them, will let you know.

    Kindly provide us sometime.

    Thread Starter Vivek Athalye

    (@vnathalye)

    I tried adding a filter inside WCMp_Vendor_Order_Page class (class-wcmp-vendor-order-page.php file that you referred earlier) to manage the list of orders getting displayed, and the changes are getting reflected on /wp-admin/admin.php?page=dc-vendor-orders page. But these changes are not getting reflected on /wcmp/vendor-orders/ page. Looks like the /wcmp/vendor-orders/ page is handled by some other class. Any idea?
    (If I’m not wrong it’s vendor-orders.php file but as I mentioned in my first post, I’m not able to find out how / where $customer_orders variable is populated)

    Thread Starter Vivek Athalye

    (@vnathalye)

    I have forwarded this to our development team, so they can assist you better with the hook and filter you may use for this.

    Any update from your development team?

    Vivek, WCMp dashboard ‘vendor-orders’ is a different page template and ‘$customer_orders’ is populated from function named ‘wcmp_vendor_dashboard_vendor_orders_endpoint’ within class-….vendor-hook.php

    Thread Starter Vivek Athalye

    (@vnathalye)

    Ok.

    Can you (your development team) add a filter like:

    $customer_orders = apply_filters('wcmp_vendor_dashboard_vendor_orders', $customer_orders, $vendor->id, $start_date, $end_date);

    just before:

    if (!empty($customer_orders)) {

    inside function wcmp_vendor_dashboard_vendor_orders_endpoint(), so that we get more control on which orders are displayed in dashboard.

    Vivek, in our next version 3.0, we have modified many hooks and filters and we have also changed the coding structure.

    So, we would request to install the beta version of 3.0 from Github in your staging site. You can download the beta version from here – https://github.com/dualcube/dc-woocommerce-multi-vendor/archive/master.zip

    Hello sir,
    i have installed wc market place plugin and created vender but when any user create order then in vender order page only showing 4 order new order now comming after four can you please tell me why here any restriction about that i can see only 4 orders?.

    Thanks

    Hi @deepaksen137, make sure that the order status is either Processing or Completed. Only then, the vendor can see them.

    i have checked my all order is completed and processing.but still not showing.

    please check screen shot showing only 4 orders.
    https://imtp.me/e1tk02ti4.p

    in admin section have many orders by vendor:-

    https://imtp.me/e1tl02ti4.p

    • This reply was modified 6 years, 8 months ago by deepaksen137.

    hello sir,
    when you will reply me i am waiting

    Hi @deepaksen137, can you please get in touch with us via our forum : https://wc-marketplace.com/support-forum/

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Vendor Dashboard > Orders: not showing all the expected orders’ is closed to new replies.