1

Similar to "Send an Email notification to the admin for pending order status in WooCommerce" this question/answer It is the only decent answer I have found in the web about this problem, thanks to LoicTheAztec.

Now, I have a booking site where we used a WP + Woocommerce solution to sell events. Every thing is good but... If a customer makes an order and pay with bank we receive the mail order and the customer too. But if the pay with credit card (Nexi or PostFinance) non mail is sent. We used your (beautiful code) so now the customer receives two mail with bank and one with credit card. And we have some problem to receive the mail to the admin. I don't know if I made myself clear, but if you have the solution I'll be really happy and I can value to pay something for the right code to insert in function.php

We tried with this code:

// New order notification only for "Pending" Order status
add_action( 'woocommerce_checkout_order_processed', 'pending_new_order_notification', 20, 1 );
function pending_new_order_notification( $order_id ) {

// Get an instance of the WC_Order object
$order = wc_get_order( $order_id );

// Only for "pending" order status
if( ! $order->has_status( 'pending' ) ) return;

// Send "New Email" notification (to admin)
WC()->mailer()->get_emails()['WC_Email_New_Order']->trigger( $order_id );

}

  • What booking plugin are you using… Please always give that information in your question as there is many different plugins. – LoicTheAztec Feb 28 '19 at 12:19
  • Hi LoicTheAztec, I'm not using a booking plugin but just woocommerce, and selling the events as products – Stefano Paolucci Feb 28 '19 at 16:04
  • You should include in your question the related code that you are using to allow to notifications for credit card payments… You should also try to reword a bit your question as it's not so clear and understandable. – LoicTheAztec Feb 28 '19 at 16:08
  • Thanks, I try to be clearer. The woocommerce communications work perfectly when making a purchase by bank transfer. For payment by credit card we use the Nexi XPay plugin Version 3.4.2. If a customer buys but then does not pay on the NEXI external portal, no email is sent. We need the confirmation email to the manager and the customer to arrive anyway even if the payment is not successful. In another equal site we use the PostFinance E-Payment Gateway for WooCommerce plugin from mame version 2.3.5, but the problem is the same. – Stefano Paolucci Feb 28 '19 at 16:37
  • Please update/edit your question (clicking on "edit" link) instead and add the code that you have used to enable email notifications for credit card payment. – LoicTheAztec Feb 28 '19 at 16:41

0 Answers0