How do I display an invoice download button on specific template files?

In order to display an invoice download button, add the below code for example to your “thank you” page or “customer-completed-order” email template.

echo do_shortcode( '[bewpi-download-invoice title="Download (PDF) Invoice {formatted_invoice_number}" order_id="' . $order->get_id() . '"]' );

For use in WordPress editor use below shortcode. This will only work if you replace “ORDER_ID” with an actual order id.

[bewpi-download-invoice title="Download (PDF) Invoice {formatted_invoice_number}" order_id="ORDER_ID"]

Note: Download button will only be displayed when PDF exists and order has been paid.

Please test the functionality on a development environment of your website. If it ceases to work, please revert back to the original state of your website and follow the tutorial again.

Still need help? Contact Us Contact Us