WCMp Core
-
AuthorPosts
-
-
February 3, 2022 at 4:19 PM #133989MaxenceTPParticipant
Hello,
How can I download an archive with all the invoices for my site? With WCMp PDF Invoice
I have tens of thousands of orders and hundreds of pages, even downloading them 100 by 100 would take too long. -
February 3, 2022 at 6:22 PM #134006MVX Support NinjaKeymaster
Hi, thanks for getting in touch with us.
The default flow is such that admin can download either from Woocommerce order page or by clicking the individual order and vendor can download the pdf invoice from order section.
However if you are looking for some different flow you need to do custom code on your end. -
February 3, 2022 at 9:54 PM #134019MaxenceTPParticipant
No, I don’t want to change that. I just want to download all the invoices, and not do the orders one by one or page by page
-
February 4, 2022 at 5:46 PM #134054MVX Support NinjaKeymaster
In order to download pdf invoice in bulk go to vendor dashboard>orders. Over there select the pdf for the order you want to download and choose download pdf from bulk options.
Here is the video- https://www.loom.com/share/5143706c86fd40bf93d4a7c99381e815 -
February 6, 2022 at 3:08 AM #134103MaxenceTPParticipant
Yes, I know that. But with 100 orders per page, I still have 300 pages and it’s impossible for me to do all the pages.
Is there a way to create a small script in PHP that would allow me to do this with the WCMp functions for all the orders?That I can have one archive with all the PDF files in it
-
February 7, 2022 at 2:42 PM #134132MVX Support NinjaKeymaster
Let me consult with the develop, where we have any such hook/filter, that you can use to create the custom code.
-
February 7, 2022 at 3:06 PM #134139MaxenceTPParticipant
Okay, keep me informed
-
November 30, 2022 at 1:18 PM #147013NerdySupportExpert MoumitaKeymaster
This feature is added in our latest update. So we are closing this thread.
-
-
February 7, 2022 at 7:41 PM #134145MVX Support NinjaKeymaster
Hi,
As per your requirement, you have to add custom code on you end using below filter.apply_filters( 'wcmp_vendor_orders_bulk_action_ids', isset($filterActionData['selected_orders']) ? $filterActionData['selected_orders'] : array(), $filterActionData, $requestData );
CopyRegards
-
February 7, 2022 at 11:06 PM #134150MaxenceTPParticipant
Thank you, but I don’t really understand how to put all the orders into this ?
-
February 8, 2022 at 6:11 PM #134189MVX Support NinjaKeymasterThis reply has been marked as private.
-
March 12, 2022 at 5:13 PM #135305MaxenceTPParticipant
Can you please release an update of the plugin with the changes in #134189 ?
And this one too https://multivendorx.com/support-forum/topic/pdf-template-common-to-all-vendors/#post-128946 ?
-
-
February 11, 2022 at 5:01 PM #134327MaxenceTPParticipant
Can you publish the changes as an update when they are working?
These changes have not been integrated: https://multivendorx.com/support-forum/topic/pdf-template-common-to-all-vendors/#post-128946
I’m losing the changes with every update, it’s quite annoying -
February 11, 2022 at 5:02 PM #134328MaxenceTPParticipant
I tested with your plugin but I don’t understand when the filter is executed. I tried to debug the variable to see its content but the code is never executed. Can you test with this on your side too? There are supposed to be logs in the wordpress debug.log file:
Copy`add_filter(‘wcmp_vendor_orders_pdf_download_ids’,’test_function_wcmp’);
function test_function_wcmp($selected_orders) {
error_log(“DEBUG IN debug.log”);
error_log(print_r($selected_orders, true));
return $newArray;Copy`
Can you tell me more?
-
February 11, 2022 at 6:43 PM #134336MVX Support NinjaKeymaster
Hi,
This filter will trigger when you select Download PDF Invoice from dropdown and then press the Download PDF button.Checkout the image – https://prnt.sc/26tr2q3
you have to add all vendor orders id to download those PDF
Regards,
-
February 11, 2022 at 7:18 PM #134338MaxenceTPParticipant
Oohh right, I wasn’t thinking about that.
Is it possible to do that on the wp-admin panel?And do you know if it is possible to add a button that calls your function to generate the PDF?
-
February 12, 2022 at 7:06 PM #134369MVX Support NinjaKeymaster
Hi,
WCMp PDF invoice Added the function to download the pdf from admin panel using below filter –add_filter('handle_bulk_actions-edit-shop_order', array($this, 'pdf_invoice_packing_slip_bulk_action_handler'), 10, 3);
CopySo to change the default flow you have to add custom code using below filter.
You have to remover filter end add this filter with your custom function. It need good amount of custom code.For your second point you have to add custom code. The function only called when the download pdf button is clicked and dropdown selected.
Regards,
-
February 13, 2022 at 2:04 AM #134383MaxenceTPParticipant
I didn’t really understand how to remove and add the filter. I tested this :
remove_filter( 'handle_bulk_actions-edit-shop_order', 'pdf_invoice_packing_slip_bulk_action_handler', 10 ); add_filter( 'handle_bulk_actions-edit-shop_order', 'max_tesssste', 20 , 3 ); function max_tesssste($redirect_to, $doaction, $order_ids) { error_log("DEBUG IN debug.log"); error_log(print_r($order_ids, true)); }
CopyMy function is executed but the plugin function is executed too, so it is executed twice. Can you give me more information?
-
February 14, 2022 at 7:05 PM #134415MVX Support NinjaKeymaster
Hi,
To remove the filter use below code –add_action('admin_init', 'custom_changes_wcmp_pdf_invoice'); function custom_changes_wcmp_pdf_invoice(){ global $WCMp_PDF_Invoices; remove_filter('handle_bulk_actions-edit-shop_order', array($WCMp_PDF_Invoices->admin, 'pdf_invoice_packing_slip_bulk_action_handler'), 10, 3); }
CopyRegards,
-
February 15, 2022 at 4:59 PM #134442MaxenceTPParticipant
Thanks, it works 🙂
I took the code from the “pdf_invoice_packing_slip_bulk_action_handler” function so I can modify it as I want, but I don’t understand how to define “$this->pdf_actions” in this code?add_filter( 'handle_bulk_actions-edit-shop_order', 'max_tesssste', 10 , 3 ); function max_tesssste($redirect_to, $doaction, $order_ids) { global $WCMp_PDF_Invoices; if (!array_key_exists($doaction, $this->pdf_actions)){ // <------------- HERE return $redirect_to; } if (empty($order_ids)) { return $redirect_to; } $general_settings = get_wcmp_pdf_invoices_settings(); $args = array( 'order_ids' => $order_ids, 'user_id' => get_current_user_id(), 'user_type' => 'admin', 'settings' => $general_settings ); $html = $WCMp_PDF_Invoices->utils->get_html($doaction, $args); if ($html) { $pdf_maker = get_wcmp_pdf_invoices_pdfmaker( $html, $general_settings ); $pdf = $pdf_maker->output(); wcmp_pdf_invoices_pdf_headers( $doaction.'.pdf', $general_settings['pdf_output'], $pdf ); echo $pdf; die(); } exit; }
Copy -
February 15, 2022 at 7:23 PM #134443MVX Support NinjaKeymaster
We pass these variables via $this
So you need to pass a new variable along with new variable content. For reference check class-wcmp-pdf-invoices-admin.php -
February 19, 2022 at 7:36 PM #134648MaxenceTPParticipant
Thank you 🙂
I have another question, I use this code to get all orders_ids:
$query = new WC_Order_Query( array( 'orderby' => 'date', 'order' => 'DESC', 'return' => 'ids', 'status' => array('wc-completed', 'wc-processing'), 'date_paid' => '2018-01-01...2022-12-31', 'vendor' => '??', ) ); $order_ids = $query->get_orders();
CopyBut how to retrieve only orders from a specific vendor?
-
February 19, 2022 at 7:40 PM #134649MaxenceTPParticipant
I have another question regarding WCMp Core, I have orders that were placed several years ago before the suborders system was implemented.
I have orders that were placed years ago before the suborder system was implemented, so the vendors don’t have access to these very old orders, how do I generate the suborders for the orders that don’t have them? -
February 21, 2022 at 6:22 PM #134681MVX Support NinjaKeymaster
Hi,
using below code you can get all vendor order$user_id = get_current_vendor_id();
Copythen use
'author' => $user_id,
CopyRegards
-
February 22, 2022 at 10:36 AM #134704NerdySupportExpert MoumitaKeymaster
@MaxenceTP, when we released the split order module, we had our migration cron that will convert all the old orders into suborders. You can rerun this cron via WCMp >> Settings >> Tools and click on “Force WCMp order migrate” : https://prnt.sc/4M8uFzroTIsY
-
March 5, 2022 at 10:53 PM #135135MaxenceTPParticipantThis reply has been marked as private.
-
March 5, 2022 at 10:54 PM #135136MaxenceTPParticipantThis reply has been marked as private.
-
March 7, 2022 at 11:08 AM #135133MaxenceTPParticipantThis reply has been marked as private.
-
March 7, 2022 at 11:08 AM #135134MaxenceTPParticipantThis reply has been marked as private.
-
-
March 5, 2022 at 10:55 PM #135137MaxenceTPParticipantThis reply has been marked as private.
-
March 7, 2022 at 5:19 PM #135170NerdySupportExpert MoumitaKeymasterThis reply has been marked as private.
-
March 11, 2022 at 11:40 PM #135280MaxenceTPParticipant
It was obviously orders that were deleted but the commissions were not deleted with them.
So I deleted them manually and started the migration again. No change, the sub-orders are still not created.The link to the video does not work either.
Can you please look again?
-
-
March 12, 2022 at 2:36 PM #135294NerdySupportExpert MoumitaKeymaster
Maxence you need to follow this video https://watch.screencastify.com/v/uSGP7NCNLUO3k7FcM9f9
I checked the video, it is working fine.Anyway, here is also a screenshot of the setting that you need to follow, goto mail order details and click on “generate suborder” : https://prnt.sc/_RrWc3MdGJ46
-
March 12, 2022 at 5:30 PM #135307MaxenceTPParticipant
The solution of putting all the orders_id works but has its limits, I can’t upload more than 250 orders in a PDF without the site crashing.
I would have to do this 120 times to download 250 invoices at a time, which is still too long.
What other solution can you suggest? -
March 14, 2022 at 8:37 PM #135364NerdySupportExpert MoumitaKeymaster
@MaxenceTP, let me consult this with my team, where you can generate Sub order using bulk edit.
-
March 15, 2022 at 4:16 PM #135403MaxenceTPParticipant
Ok, keep me informed
-
March 15, 2022 at 6:50 PM #135419MVX Support NinjaKeymaster
Hi,
To add this functionality to bulk action you have to add custom code
Using below code, you can add custom mane and add some function as per your requirement.// Add a bulk action to Orders bulk actions dropdown add_filter( 'bulk_actions-edit-shop_order', 'decrease_meals_orders_bulk_actions' ); function decrease_meals_orders_bulk_actions( $bulk_actions ) { $bulk_actions['custom_id'] = 'custom text'; return $bulk_actions; } // Process the bulk action from selected orders add_filter( 'handle_bulk_actions-edit-shop_order', 'decrease_meals_bulk_action_edit_shop_order', 10, 3 ); function decrease_meals_bulk_action_edit_shop_order( $redirect_to, $action, $post_ids ) { if ( $action === 'custom_id' ){ $processed_ids = array(); // Initializing foreach ( $post_ids as $post_id ) { //your custom code } } return $redirect_to; }
CopyThen you have to add custom code.
As a reference kindly check below file after line no 549
https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/blob/master/classes/class-wcmp-admin.phpRegards,
-
March 15, 2022 at 7:04 PM #135421MaxenceTPParticipant
What is the code to put to generate the suborders if they don’t already exist ?
-
March 16, 2022 at 6:29 PM #135498MVX Support NinjaKeymaster
@MaxenceTP, I am afraid we don’t have any ready-made code for this. so you have to follow the code shared here (https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/blob/master/classes/class-wcmp-admin.php), apply the same via the custom code.
-
March 18, 2022 at 2:23 AM #135562MaxenceTPParticipant
In the code in your answer #135419, $posts_id is the list of selected orders?
I just need to put lines 607 and 608 in “Your custom code”, right?
But wouldn’t it be easier to fix the “Force WCMp order migrate” button bug? https://prnt.sc/4M8uFzroTIsY
-
March 21, 2022 at 6:38 PM #135631MVX Support NinjaKeymaster
Hi,
We will check this on our end, If possible then will add this functionality in our next update.Regards,
-
March 21, 2022 at 6:41 PM #135632MaxenceTPParticipant
Ok, I’m waiting for it :/
-
March 23, 2022 at 8:55 PM #135718NerdySupportExpert MoumitaKeymaster
We have added this feature. Kindly check.
-
March 25, 2022 at 1:23 AM #135780MaxenceTPParticipant
Thank you it’s working 🙂
But by the way the “Tool” button still do nothing -
April 5, 2022 at 9:00 PM #136150NerdySupportExpert MoumitaKeymaster
@MaxenceTP, we will check with the team.
-
April 30, 2022 at 10:31 PM #137003MaxenceTPParticipant
Has the patch been released or not yet?
-
July 16, 2022 at 11:49 PM #140685MaxenceTPParticipant
Is it possible to export as an admin all the orders of all vendors in a CSV file ?
-
July 26, 2022 at 1:55 PM #140877NerdySupportExpert MoumitaKeymaster
@MaxenceTP, Currently this feature is not supported.
However, you can definitely use woocommerce hook and create this module for your site. If you need a reference of hook/filter, let us know.
Please note this module requires huge amount of coding. -
September 9, 2022 at 11:34 PM #141857MaxenceTPParticipant
I would appreciate some instruction on how to do this please 🙂
-
-
AuthorPosts
The topic ‘Download all invoices’ is closed to new replies.