Send an Email notification to the admin for pending order status in WooCommerce

后端 未结 2 1789
孤街浪徒
孤街浪徒 2020-12-05 05:52

In WooCommerce, when a customer goes to checkout from cart and submit the order, if the payment is not processed, the order is set to \"pending\" payment. The Admin doesn\'t

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-05 06:50

    I've tried with LoicTheAztec answer, @LoicTheAztec thanks a lot for your great code.

    I have just changed the action hook from woocommerce_new_order to woocommerce_checkout_order_processed to get it to work.

    Here is the action : add_action( 'woocommerce_checkout_order_processed', 'pending_new_order_notification', 20, 1 );

    Hope that helps.

提交回复
热议问题