Get 30d revenue from vendors via code

Hey there,

is there a way to get the last 30d revenue from a vendor? We took a look at the code of the statistics plugin, however were unable to find a proper code snippet we could reuse for our case.

May you have something we could work with?

Thanks a lot!

At least a hint would be appreciated! Thanks a lot @ihor

I’m sorry for the delay. This is related to WooCommerce, please try using wc_get_orders function or a custom SQL query like this one wordpress - Get WooCommerce Total Sales Dollar Amount (revenue) - Stack Overflow to get a revenue of recent orders. You can filter orders by the post meta field hp_vendor, it stores the vendor ID.

Hope this helps.