Hi @aperezvde,
I want to change the route where it gets the PDFs that are attached in the mail. The original path is wp-content/uploads/wpo_wcpdf And I want you now to take them from wp-content/uploads/pdf_orders
You can customize the temporary folder for the attachments by adding this code snippet to your site:
/**
* Change the PDF document temp path to 'wp-content/uploads/pdf_orders/'
*/
add_filter( 'wpo_wcpdf_tmp_path_attachments', function( $tmp_path ) {
$upload_dir = wp_upload_dir();
$upload_dir_path = $upload_dir['basedir'];
$attachments_tmp_path = $upload_dir_path . '/pdf_orders/';
if ( ! is_dir( $attachments_tmp_path ) ) {
mkdir( $attachments_tmp_path, 0700 );
}
return $attachments_tmp_path;
}, 10, 1 );
If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters
However, this code snippet needs a new improvement that will be available in the next release, so I have prepared a beta release for you, so you can enjoy this enhancement before it’s public available. In short, please replace your installed version of the plugin with this one: https://we.tl/t-Kqv5rIRhn1
and the PDFs have the name of (idorder)_cotizacion_(nameblog).pdf
You can customize your PDF document filename with the Professional extension:
Or using the wpo_wcpdf_filename
filter hook. See some examples here: Custom PDF filenames