1

i want to send sms to shop owner when customer is canceled some order.

the question is, if there is any parameter that store if the customer is canceled or the shop owner?

i will use to send sms with:

add_action('woocommerce_order_status_cancelled', '');

Thanks

0

1 Answer 1

0
  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.

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