How to automatically update order status in WooCommerce based on order# prefix
I have a custom WooCommerce environment that imports eBay and Amazon orders alongside native WooCommerce orders.
I use a plugin called LitCommerce which syncs with WooCommerce to initiate the eBay/Amazon order creation in WooCommerce. LitCommerce creates a new order in WooCommerce and sends all of the customer, cost, and SKU details.
For my Amazon orders I set the order# prefix to "M-" and the eBay order# prefix to "E-".
I have created custom order statuses "Amazon" and eBay" for those orders.
My hope is that at the time of order creation there could be a way to check if the new order number being created contains one of the specified prefixes and assign the specified status accordingly.
Can anyone suggest a PHP snippet I might add that can identify when the order# contains "M-" or "E-" and assign to the designated "Amazon" or "eBay" custom status accordingly?
Comments
Post a Comment