'Is it possible to perform an automatic action on the order when using a coupon? - WooCommerce

First of all, I will try to explain my problem. Basically, I have an online store built in WooCommerce and, so far, everything is working properly.

In parallel with another plugin, an invoice-receipt is generated as soon as the customer pays for the order.

However, I have the need to develop another scenario: I want that, when a specific discount code is applied (for example “Filipe”, who will be a commercial/traveler of ours), in addition to the order having to go to the ” Waiting for payment confirmation” without going through the “Processing” state (otherwise the invoice-receipt is issued automatically), an invoice is generated, because this discount code will only be used with customers who have special payment terms.

I await your help.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source