I added this code add_action( 'woocommerce_admin_order_data_after_billing_address', array(new BEWPI_Packing_Slip(), 'add_packing_slip_pdf'),12,1);
in functions.php
and the button is working fine. However, receiving the following error as well.
Warning: Missing argument 1 for BEWPI_Packing_Slip::__construct(), called in /srv/bindings/31d58a9b086a4516a078df34c8e2c4bf/code/wp-content/themes/flatsome-child/functions.php on line 449 and defined in /srv/bindings/31d58a9b086a4516a078df34c8e2c4bf/code/wp-content/plugins/woocommerce-pdf-invoices/includes/class-packing-slip.php on line 24
Where I have to pass the $order_id
as argument? or how to fix the issue?
Thanks.
I’ve fixed the issue. I’d to pass the $order_id
as below:
add_action( 'woocommerce_admin_order_data_after_billing_address', array(new BEWPI_Packing_Slip($order_id), 'add_packing_slip_pdf'),12,1);
It would be better if you add this code to FAQ of the plugin and it will be helpful to someone else as well.