Created
May 9, 2025 11:17
-
-
Save rajeshsingh520/3da8c1486af826551d55ecaac64f234e to your computer and use it in GitHub Desktop.
adding download invoice link in the google calendar order details page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('pi_dtt_google_calendar_event_desc', function($desc, $order){ | |
$order_id = $order->get_id(); | |
$download_url = add_query_arg( | |
array( | |
'action' => 'generate_wpo_wcpdf', | |
'document_type' => 'invoice', | |
'order_ids' => $order_id, | |
'_wpnonce' => wp_create_nonce( 'generate_wpo_wcpdf' ), | |
), | |
admin_url( 'admin-ajax.php' ) | |
); | |
$desc .= '<br><br>'; | |
$desc .= '<a href="' . esc_url( $download_url ) . '" target="_blank">' . __( 'Download Invoice', 'woocommerce-pdf-invoices-packing-slips' ) . '</a>'; | |
$desc .= '<br><br>'; | |
return $desc; | |
}, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment