0

I am using woocommerce for a "multi-seller" system. Meaning one site (no multi-site), but many sellers with different products.

To let each owner only manage it's own orders, it would like to filter all orders before they are shown in the admin area. The criteria for filtering could be a tag or the creator of the product.

Is there a hook or filter to create the desired result? If not, what else could be a solution?

2
+50

WooCommerce does not support this specific scenario. The primary issue in this case being that WooCommerce processes orders at the order level NOT the line item level.

So if a customer were to order items from multiple sellers you create a situation that will cause serious problems and headaches. When the first seller marks the order as processed the entire order (each and every line item) is also marked as processed. Even if the seller of the second or subsequent line item(s) haven't processed the order.

Those items would never be made, packed, or shipped.

That being said you can filter the WooCommerce admin order view by using woocommerce_custom_order_views(). You can see the documentation at http://wcdocs.woothemes.com/apidocs/function-woocommerce_custom_order_views.html

Since products are 'posts' each product has a post_author that would equate to the author/creator of the product. Each order has a serialized list (wp_postmeta._order_items) of the line items, including the line item's wp_posts.ID

So with a bit of work you could determine which orders contain items created by a specific seller (user), then filter the display appropriately.

  • Thx for your suggestions and your additional notice. I do hope I am not asking the obvious, but where do I hook into, to customize the orders query? – SunnyRed Nov 3 '12 at 19:04
  • 1
    Honestly not had call to do this do I don't have a specific answer. But rather than the woocommerce_add_custom_query_var() I mentioned I found this filter: woocommerce_custom_order_views. I think it would be a better match for what you're trying to do. Check the WooCommerce API docs at wcdocs.woothemes.com/apidocs/… as a starting point. – Steve Nov 3 '12 at 21:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.