Support » Plugin: WooCommerce Print Invoice & Delivery Note » Delivery print in account page

  • Hi, there is any way to add a button in to account page to print delivery note with the invoice button?

Viewing 1 replies (of 1 total)
  • Plugin Contributor Rashmi Malpande

    (@rashmim)

    Hi @glepera2

    The plugin does not have this functionality currently. You will have to add some custom code to do this. You can use the filter ‘woocommerce_my_account_my_orders_actions’ to add the button on the My Account page.

    Add the following code in your theme’s functions.php file –

    
    add_filter( '
    woocommerce_my_account_my_orders_actions', 'delivery_button_account_page', 10, 2 );
    
    function delivery_button_account_page( $actions, $order ) {
    	if( get_option( 'wcdn_print_button_on_my_account_page' ) == 'yes' ) {
    
    		$wdn_order_id =  ( version_compare( get_option( 'woocommerce_version' ), '3.0.0', ">="  ) ) ? $order->get_id() : $order->id;
    		$actions['print-delivery'] = array(
    				'url'  => wcdn_get_print_link( $wdn_order_id, 'delivery-note' ),
    				'name' => __( 'Print Delivery Note', 'woocommerce-delivery-notes' )
    		);
    	}
    	return $actions;
    }

    Let me know if you have any problems.

    Regards,
    Rashmi

Viewing 1 replies (of 1 total)
  • The topic ‘Delivery print in account page’ is closed to new replies.