• Hello,
    I have to check order items for stock (stock is checked through REST API from ERP and if stock is 0 then I should remove that item from order) after user have pressed Submit and before order is created and invoice will be generated. I plan to do that check using woocommerce_review_order_after_submit hook. Is that hook the right place to do that or its too late?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jaak69

    (@jaak69)

    Hook is wrong.
    woocommerce_checkout_order_processed have to be used but question remains will invoice will be generated after that hook?

    Plugin Contributor Ewout

    (@pomegranate)

    The invoice is generated automatically when it is attached to the email. Depending on which email you are attaching this to, it could be before or after the woocommerce_checkout_order_processed hook. Since most status transitions are happening after that hook, you’re probably just in time.

    The only definitive answer you will get is by simply testing this on your site (with your gateways/configurations).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Update new order before invoice is generated’ is closed to new replies.