Send New Vendor Order email when status changes to ‘processing’

WCMp Core

Send New Vendor Order email when status changes to ‘processing’ Resolved

Viewing 5 reply threads
  • Author
    Posts
    • #89726
      julz52
      Participant

      Hi,

      We recently updated WCMP to your new version with suborders, and it has caused quite a few issues.

      I need some up-to-date code that will send the vendor_new_order email to the vendor when the status of the order has changed to ‘processing’.

      Currently it sends it once when the order is ‘on-hold’, but does not send it again when the order has been changed to processing.
      I have tried various code but can’t make it work.

      $email_vendor = WC()->mailer()->emails[‘WC_Email_Vendor_New_Order’];$email_vendor->trigger($order_id);
      copy

      does not seem to work anymore, I get Undefined index: ‘WC_Email_Vendor_New_Order’

      Please provide the new code to trigger the vendor_new_order email to be sent to vendors.

      p.s. your tooltip under Woocommerce -> Settings -> Emails -> Vendor New order is now incorrect. It states ‘New order email notifications are sent when order is processing’. This is no longer the case.
      https://imgur.com/a/gEGob5b

      p.s.s. Your update now does not work with WooCommerce dropshipping plugin. Woocommerce dropshipping plugin now sends 2 emails to the vendor for each order. One for the parent order ID and one for the child order ID. The emails from this plugin have a packing slip attachment. Now vendors get two emails with two packing slips with two order numbers !?!?

    • #89748
    • #89801
      julz52
      Participant

      Thanks for that.

      Can you please also provide the code to trigger the vendor new order email to send? As the above code seems to no longer work.

    • #89805
      julz52
      Participant

      Never mind, I worked it out. This will trigger the vendor new order email to send:

      $emails = WC()->mailer()->emails;
      $email_vendor = $emails['WC_Email_Vendor_New_Order']->trigger($order_id);
      copy

      And I used the trigger

      woocommerce_order_status_processing
      copy

      as this seems to fire when an order is changed to processing.

      Final working code:

      function send_vendor_new_order_email($order_id) {
      	
      	$emails = WC()->mailer()->emails;
      	$email_vendor = $emails['WC_Email_Vendor_New_Order']->trigger($order_id);
      
      }
       add_filter('woocommerce_order_status_processing', 'send_vendor_new_order_email', 1, 2);
      copy
    • #89809

      Thanks, @julz52, for helping our users out.

    • #89810

      Thanks, @julz52, for helping our users out.

Viewing 5 reply threads

The topic ‘Send New Vendor Order email when status changes to ‘processing’’ is closed to new replies.

WCMp bundle is available at a slashed price

Grab It Now