Hello Support Team,
I am encountering an error with the mPDF Addon for PDF Invoices on my WordPress site. After updating to PHP 8.2, I received the following message in the error log:[14-Oct-2024 13:43:02 UTC] PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /bitnami/wordpress/wp-content/plugins/mpdf-addon-for-pdf-invoices/vendor/mpdf/mpdf/src/Mpdf.php on line 6560
It seems that the plugin is trying to pass a null value to the strpos()
function, which is not compatible with PHP 8.2. Could you please provide guidance on how to resolve this issue, or let me know if there is an update available that addresses compatibility with PHP 8.2?
Thank you.
]]>>PHP Fatal error: Declaration of Psr\Log\NullLogger::log($level, $message, array $context = []) must be compatible with Psr\Log\LoggerInterface::log($level, Stringable|string $message, array $context = []): void in /var/www/z/wp-content/plugins/mpdf-addon-for-pdf-invoices/vendor/psr/log/Psr/Log/NullLogger.php on line 26
PHP 8.1
Plugin version 1.2.1
This causes a fatal error whenever an order is marked as complete (hence generating the invoice). Refreshing the page shows the order page correctly but trying to download the invoice triggers the error too.
I changed line 26 to:public function log($level, $message, array $context = []): void
That fixed the error. Is this something you can add to the next release?
]]>We’re using this plugin in conjunction with https://www.ads-software.com/plugins/print-invoices-packing-slip-labels-for-woocommerce/.
We’re using Woo’s API to programmatically create orders; however, these calls are failing due to the following error:
[28-Aug-2024 21:05:10 UTC] PHP Fatal error: Uncaught Error: Call to a member function children() on null in /home/example/public_html/wp-content/plugins/mpdf-addon-for-pdf-invoices/wt-woocommerce-packing-list-mpdf.php:301
Stack trace:
#0 /home/example/public_html/wp-includes/class-wp-hook.php(324): Wt_Pklist_Mpdf_Addon->alter_final_order_template_html('<div class="wft...', 'invoice', Object(Automattic\WooCommerce\Admin\Overrides\Order), NULL, NULL, true)
#1 /home/example/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters('<div class="wft...', Array)
#2 /home/example/public_html/wp-content/plugins/print-invoices-packing-slip-labels-for-woocommerce/admin/modules/customizer/customizer.php(1186): apply_filters('wt_pklist_alter...', '<div class="wft...', 'invoice', Object(Automattic\WooCommerce\Admin\Overrides\Order), NULL, NULL, true)
#3 /home/example/public_html/wp-content/plugins/print-invoices-packing-slip-labels-for-woocommerce/public/modules/invoice/invoice.php(1784): Wf_Woocommerce_Packing_List_Customizer->generate_template_html('<div class="wft...', 'invoice', Object(Automattic\WooCommerce\Admin\Overrides\Order))
#4 /home/example/public_html/wp-content/plugins/print-invoices-packing-slip-labels-for-woocommerce/public/modules/invoice/invoice.php(1725): Wf_Woocommerce_Packing_List_Invoice->generate_order_template_for_single_order(98068, 'Invoice_98068', '<div class="wft...', '')
#5 /home/example/public_html/wp-content/plugins/print-invoices-packing-slip-labels-for-woocommerce/public/modules/invoice/invoice.php(1503): Wf_Woocommerce_Packing_List_Invoice->generate_order_template(Array, 'Invoice_98068')
#6 /home/example/public_html/wp-includes/class-wp-hook.php(324): Wf_Woocommerce_Packing_List_Invoice->add_email_attachments(Array, Object(wf_order), 98068, 'new_order')
#7 /home/example/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)
#8 /home/example/public_html/wp-content/plugins/print-invoices-packing-slip-labels-for-woocommerce/admin/class-wf-woocommerce-packing-list-admin.php(270): apply_filters('wt_email_attach...', Array, Object(wf_order), 98068, 'new_order')
#9 /home/example/public_html/wp-includes/class-wp-hook.php(326): Wf_Woocommerce_Packing_List_Admin->add_email_attachments(Array, 'new_order', Object(wf_order))
#10 /home/example/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)
#11 /home/example/public_html/wp-content/plugins/woocommerce/includes/emails/class-wc-email.php(477): apply_filters('woocommerce_ema...', Array, 'new_order', Object(WC_Order), Object(WC_Email_New_Order))
#12 /home/example/public_html/wp-content/plugins/woocommerce/includes/emails/class-wc-email-new-order.php(112): WC_Email->get_attachments()
#13 /home/example/public_html/wp-includes/class-wp-hook.php(324): WC_Email_New_Order->trigger(98068, Object(WC_Order))
#14 /home/example/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#15 /home/example/public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#16 /home/example/public_html/wp-content/plugins/woocommerce/includes/class-wc-emails.php(172): do_action_ref_array('woocommerce_ord...', Array)
#17 /home/example/public_html/wp-includes/class-wp-hook.php(324): WC_Emails::send_transactional_email(Array, Object(WC_Order))
#18 /home/example/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#19 /home/example/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#20 /home/example/public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php(420): do_action('woocommerce_ord...', 98068, Object(WC_Order))
#21 /home/example/public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php(253): WC_Order->status_transition()
#22 /home/example/public_html/wp-content/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-orders-controller.php(226): WC_Order->save()
#23 /home/example/public_html/wp-content/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-crud-controller.php(191): WC_REST_Orders_Controller->save_object(Object(WP_REST_Request), true)
#24 /home/example/public_html/wp-content/plugins/woocommerce-zapier/src/TaskHistory/Listener/APIListenerTrait.php(50): WC_REST_CRUD_Controller->create_item(Object(WP_REST_Request))
#25 /home/example/public_html/wp-includes/rest-api/class-wp-rest-server.php(1230): OM4\WooCommerceZapier\WooCommerceResource\Order\Controller->create_item(Object(WP_REST_Request))
#26 /home/example/public_html/wp-includes/rest-api/class-wp-rest-server.php(1063): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wc-zapier/v1/o...', Array, NULL)
#27 /home/example/public_html/wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server->dispatch(Object(WP_REST_Request))
#28 /home/example/public_html/wp-includes/rest-api.php(420): WP_REST_Server->serve_request('/wc-zapier/v1/o...')
#29 /home/example/public_html/wp-includes/class-wp-hook.php(324): rest_api_loaded(Object(WP))
#30 /home/example/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#31 /home/example/public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#32 /home/example/public_html/wp-includes/class-wp.php(418): do_action_ref_array('parse_request', Array)
#33 /home/example/public_html/wp-includes/class-wp.php(813): WP->parse_request('')
#34 /home/example/public_html/wp-includes/functions.php(1336): WP->main('')
#35 /home/example/public_html/wp-blog-header.php(16): wp()
#36 /home/example/public_html/index.php(17): require('/home/example...')
#37 {main}
thrown in /home/example/public_html/wp-content/plugins/mpdf-addon-for-pdf-invoices/wt-woocommerce-packing-list-mpdf.php on line 301
In /wp-content/plugins/mpdf-addon-for-pdf-invoices/wt-woocommerce-packing-list-mpdf.php
, could lines 301 through 308 be updated to:
$children = $product_table_body_elm->children( 0 );
if( $children ) {
foreach( $children->children() as $td_elm ) {
if( $td_elm->tag == 'td' ) {
$td_elm->style = $product_table_body_style;
}
}
}
This’ll run that code only when the parent node has children and prevent the fatal error.
Thanks!
]]>Should have posted this in the main plugins support area.
We have noticed that if a customer orders an item that is backordered (which we allow), the item’s quantity still shows up on the packing list as though it is in the package. For example, the customer orders 2 items that are in stock and 1 item that is backordered. The packing slip clearly states what is backordered–that is great. However–the packing slip indicates there are 3 items in the package (in two places on the packing list–“No. of items” and “Quantity”). That is not correct–there are only 2 items in the package. Is there a way to fix this?
]]>Is it possible to separate two invoice series? I need to invoice courses on a serie A, and the rest of products on serie B. Thanks!
]]>it is possible to establish a higher invoice number, example I have 0w29 and I want the next one to be 0w31, thanks
]]>Hi,
If Dompdf has bugs processing UTF8 characters, why don’t you use Mpdf by default ?
is there any drawback using Mpdf library ?
Hello,
ii use your plugin i want to add qr code to invoice how can add it
]]>Hi
How can I add ability to download Invoice (PDF) to My Orders tab on Custom My Account page? (by the buyer)
]]>The plugin has been translated into Persian, but the professional version of the plugin is not available in Persian
]]>Hi, I have a problem that I don’t know how to solve. Tried a a lot of things, but none worked.
Every time I generate an invoice, the address is missing. Instead of showing the clients address, it shows their name and the shipping zone selected by them and nothing else.
Any ideia on how I can solve this?
Thank you!
]]>I’ve noticed an issue with the invoice coming out wrong when the order is a bit bigger, the words at the bottom of the invoice are intersecting, I’ll attach a pdf file of an invoice as sample for you to look at.
]]>