WCMp PDF Invoice
-
AuthorPosts
-
-
October 20, 2021 at 4:59 AM #129265
Zia Rahim
ParticipantHi
I bought the PDF invoice plugin but cannot find an option to email the vendor the packing slip and invoice. They are so busy, they cannot always login and check their dashboard.
Can you provide some custom code I can add to the functions.php file to do this?
-
October 20, 2021 at 3:16 PM #129282
MVX Support Ninja
KeymasterHello thank you for getting in touch with us, at present we don’t have any provision of sending invoice mail and packing slip mail to the vendors.
As you can understand the flow you are looking for is itself a huge enhancement. Now generally we do help our user with code snippet but if that requires 10-12 lines of code. The flow you are looking for requires a good amount of custom code. If you have any developers, ask them to contact us so we can help you out with the coding procedure.
Alternatively, you may hire our service team (https://multivendorx.com/custom-development/) so they can add this feature in your site. -
October 20, 2021 at 5:53 PM #129289
Zia Rahim
ParticipantI am a dev.
Here is some code I have. Can you help with a few edits to send the packing slip?
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); -
October 21, 2021 at 5:42 PM #129346
GeekyCoder Abhirup
ModeratorHi,
Kindly add below code in the function.php of the current active theme :add_filter( 'woocommerce_email_attachments', 'attach_packingslip_to_email' , 999, 4 ); function attach_packingslip_to_email( $attachments, $email_id, $order, $email = null ) { global $WCMp_PDF_Invoices; if ( !is_object( $order ) || !isset( $email_id ) ) { return $attachments; } // Skip User emails if ( get_class( $order ) == 'WP_User' ) { return $attachments; } if($email_id == 'vendor_new_order') { $attachments[] = $WCMp_PDF_Invoices->utils->get_pdf_attachments($order->get_id(), array('pdf_type' => 'packing_slip' ) ); } return $attachments; }
CopyRegards,
-
October 22, 2021 at 5:15 AM #129385
Zia Rahim
ParticipantThank you very much, I will give it a try.
-
October 22, 2021 at 10:19 AM #129388
MVX Support Ninja
Keymasteryour welcome , please let us know
-
-
AuthorPosts
The topic ‘Send Vendor packing slip and invoice on new order’ is closed to new replies.