Support » Plugin: WooCommerce PDF Invoices » Add View Packing Slip button to Edit Order page

  • Resolved ravimallya

    (@ravimallya)


    Hi,

    How to add the “View Packing Slip” button to the ‘woocommerce_admin_order_data_after_billing_address‘ action hook in edit order page? Is there any shortcode available? I couldn’t find anywhere. Please advice.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add View Packing Slip button to Edit Order page’ is closed to new replies.