Public Ticket #4022938

You have X New Orders Dashboard Alert

Closed
Comments
12 Tickets 8
Miguel Zenha started the conversation 1 year ago on May 22, 2025 at 10:32am

Hi!

Our hybrid store works with different payment methods for B2C and B2B users.

B2C users: credit card, paypal, etc (all payment methods except invoice payment).

B2B users: only invoice payments. Invoice payments don't go to the "processing" status right away. They have to be manually approved and changed to "processing" status manually, because they pay monthly or yearly.


However, the dashboard section that says "you have X new orders" only shows the total number of orders that are in processing status.

As you can see from the screenshot, it shows that we have 1 new order: 
https://prnt.sc/6PXbYRXSIkna

However, we have 4 new orders that were made by B2B users, which are not being counted because they are in the status "awating payment": https://prnt.sc/2vDOHL4qDxeZ

This behaviour is correct because usually in a normal store we do not want warnings about orders that were not paid, but in a hybrid store we need something different because B2B users don't always pay when they order.

My main question is:

Can we change the way this count works?

Something like:
TOTAL = get all b2c processing orders + get all b2b processing orders + get all b2b awaiting payment orders.

Is this possible?

Hope to hear from you soon.

Best regards and thanks



2,762
KingsPlugins replied 1 year ago on May 26, 2025 at 11:50pm

Hi Miguel,

I can provide a code snippet that shows processing + pending payment orders combined. This snippet would show ALL pending payment orders, including B2C ones.

You can use this code for that:

add_filter('b2bking_dashboard_order_statuses', function($statuses){
	return array('processing', 'pending', 'wc-pending');
}, 10, 1);

 

Unfortunately to do this: "get all b2c processing orders + get all b2b processing orders + get all b2b awaiting payment orders." is quite difficult because we are using a standard WooCommerce order count function which doesn't support that. We could write a custom function, but performance would not be very good as it would need to check each order.

 

Kind regards,
Stefan

Sign In