Banner Logo

Be a part of the family: Connect, Receive Support,
Contribute, and Reap Abundant Rewards

E-mails getting send for sub orders even though the order is not yet paid

MultivendorX

Resolved
Viewing 7 reply threads
  • Author
    Posts
    • #219918
      dennis
      Participant

      Hello,

      At the moment – and after I updated to MultiVendorX – I have a problem that when a customer leaves my payment provider, the order is correctly in “awaiting payment” – and it gets “cancelled” after som time.

      BUT – between those times; from “awaiting payment” until the change to “cancelled”, a mail is send to the vendor with the vendor_new_order.php template, so it seems for the vendor as the orders is actually confirmed and ready to get processed.

      How can I avoid this?

    • #219945

      Hello @dennis, Please specify the order status for which you’d like your vendors to receive the new order email so that we can assist you according to that.

    • #219946
      dennis
      Participant

      I really want it to only get sent when the order status is set to “processing” 🙂

    • #219951

      Hello There, Thanks for sharing the information with us. Kindly follow this doc here https://multivendorx.com/docs/code-snippet/vendor-new-order-mail-for-some-order-status-only/ for you required customisation on your end.

      Let us know if you need any further assistance from our end.

    • #219955
      dennis
      Participant

      It seems like the documentation / article is missing a couple of lines of code?

      Which filter should it be added as?

    • #219956

      Let me share this with the team. They will check this and get back to you accordingly.

      Kindly provide us with some time.

    • #220001

      Kindly add the modified code from the below and check whether this works accordingly on your end –

      
      function restrict_vendor_new_order_mail($recipient, $order) {
         $order_status = $order == NULL ? "cancelled": $order->get_status();
         //In new order,vendor will receive only 'processing' mail no other mail will send to vendor.
         if ($order_status == 'failed' || $order_status == 'on-hold' || $order_status == 'cancelled' || $order_status == 'pending' && !$order_status == 'processing') {
             return;
         } else {
             return $recipient;
         }
      }
      add_filter('woocommerce_email_recipient_vendor_new_order', 'restrict_vendor_new_order_mail', 1, 2);
      
      Copy

      Let us know if you need any further assistance from our end.

    • #221639

      It’s been long and we have not heard back from you. We presume that your query is resolved now. We are closing this thread. If you need help or face issue in future please do create a new support ticket.

Viewing 7 reply threads

The topic ‘E-mails getting send for sub orders even though the order is not yet paid’ is closed to new replies.