Answers
Looks like your your do/while conditional checks the get_status() method's return value against un-prefixed strings "pending" and "failed", while the update_status() method in the second block of code is presumably setting the class variable for order status to stings that all include a "wc-" prefix (wc-failed, wc-processing, wc-completed etc).
Change $loopOrder->get_status() == "pending" to $loopOrder->get_status() == "wc-pending" and $loopOrder->get_status() == "failed" to $loopOrder->get_status() == "wc-failed" in your first block.
0 comments:
Post a Comment
Thanks