Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rajeshsingh520/3da8c1486af826551d55ecaac64f234e to your computer and use it in GitHub Desktop.
Save rajeshsingh520/3da8c1486af826551d55ecaac64f234e to your computer and use it in GitHub Desktop.
adding download invoice link in the google calendar order details page
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