• Resolved meglio

    (@meglio)


    Since I let buyers pay directly to vendors, I’d like vendors to access all unpaid orders in their vendor dashboard AND be able to mark them as paid (i.e. switch from On Hold to Processing state).

    What should I hook into to adapt for my scenario?

Viewing 7 replies - 1 through 7 (of 7 total)
  • @meglio, in order to display the orders to the vendor, when the order is On Hold, you have to do a bit of custom coding using our filter wcmp_completed_commission_statuses and add the support of “Oh Hold” order along with “Processing” and “Completed”.

    Thread Starter meglio

    (@meglio)

    Would you consider adding a setting for the shop admin to let vendors see the “On Hold” orders (OFF by default)?

    @meglio,

    As the order is on hold, it will create confusion on vendors mind. Hence we would not like to display the on hold orders.

    In fact we don’t want to enable those on settings page too, to avoid confusion. However, for specific needs the hook is there to enable the same.

    Thread Starter meglio

    (@meglio)

    I added the following two hooks making “pending” a “completed” status, not a “reversed” status (even though I’m not pretty sure why a “pending” was “completed” – may you elaborate pls?)

    // Make Pending orders visible to vendors
    add_filter('wcmp_completed_commission_statuses', function($statuses) {
        if (!in_array('pending', $statuses)) {
            $statuses = array_merge(['pending'], $statuses);
        }
        return $statuses;
    }, 10, 1);
    
    // Make Pending orders visible to vendors
    add_filter('wcmp_reversed_commission_statuses', function($statuses) {
        $ind = array_search('pending', $statuses);
        if ($ind !== false) {
            unset($statuses[$ind]);
        }
        // Reset index
        return array_values($statuses);
    }, 10, 1);

    Now, it didn’t help: vendors still don’t see?pending orders in their dashboard. What am I missing?

    Thread Starter meglio

    (@meglio)

    I think I got it:

    // Make On-hold orders visible to vendors
    add_filter('wcmp_completed_commission_statuses', function($statuses) {
        if (!in_array('on-hold', $statuses)) {
            $statuses = array_merge(['on-hold'], $statuses);
        }
        return $statuses;
    }, 10, 1);
    

    @dualcube, now, after the vendor marks an order as “shipped”, it still shows as “On-hold”. Where should I hook to automatically mark the order as “Completed” as soon as it’s marked as “Shipped” by the vendor? — Many thanks for your help!

    @meglio, the reason we don’t let the vendor mark the order as completed, is because an order can have products from multiple vendors. Hence, when a vendor will mark the order as shipped, then if the system also marks the order as complete, this will not mean that the other vendor has also shipped their part of the order.

    Hence, we only let the admin mark the order as completed.

    Let us know if you have any further query.

    Hey do you think it is good idea?

    Buyer will cheat on your, receipt money of outside your website. and freedom to trade on your website without pay any fee. because you are not hold seller money.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to allow vendors to see unpaid orders and mark them as paid’ is closed to new replies.