Woocommerce: how to know if the customer is canceled the order or the shop owner? [closed]

  1. Would the owner really be ordering/cancelling oders that often? If not just trigger the notification on every cancellation.
  2. You could add a check against current user info and so long as its not the owners id – send the notification.

Maybe start with this:

wp_get_current_user()

Or use:

global $current_user;

Directly. It should not be too hard to check if user is logged in and NOT owner before sending notification but this depends on users logged in. Not sure of a way to check in instances when the users are not logged in other than perhaps dropping a cookie on specific IPs or checking the IP directly if the owner will only ever order from 1 location.

IMHO logged in checks would be the way to go.