My store is built on WooCommerce with WP-Lister for eBay Pro ([url removed, login to view]) and WP-Lister for Amazon Pro ([url removed, login to view]) plugins. At the time of completing the orders they have no shipping information – it is bulk imported to WooCommerce later, therefore I need both plugins resubmit order details to eBay and Amazon.
The task is to write a function/action which will use REST API or WC_Order::update_status() to re-update orders’ status to Completed. Conditions:
- Only orders made on eBay or Amazon with provided tracking number will be updated (either tracking_number or wpla_tracking_number custom fields for the order have value)
- update orders for which status change from Processing/On hold/Pending payment to Completed occurred today().
Action will be executed from server’s Cron one time daily and I would like also to have a possibility of manual execution for given date, i.e. by entering:
https://mywebsite/wp-admin/[url removed, login to view]?2018-03-03
action will be executed for all orders completed on 2018-03-03 for which one of the fields: tracking_number or wpla_tracking_number is not empty.