WooCommerce PDF Vouchers Snippets: Tips and Tweaks

“Woocommerce PDF Vouchers Snippets: Tips and Tweaks” Documentation by “WPWeb”

WooCommerce PDF Vouchers Snippets: Tips and Tweaks

In this document, you will find many useful snippets for customizing the functionality of WooCommerce PDF Vouchers extension.

Display redeem button on the top of QRCode page

You can add this code snippet to a custom plugin or your theme's functions.php to display redeem button on the top of QRCode page.


Remove preview image from Preview voucher pdf on single product page

You can add this code snippet to a custom plugin or your theme's functions.php to remove the preview image, while previewing the voucher on single product page.


Change download button text on downloads page

You can add this code snippet to a custom plugin or your theme's functions.php to change download button text on downloads page.


Change date format without changing to WordPress general settings

By default plugin use WordPress date and time format set in Settings -> General page. You can add this code snippet to a custom plugin or your theme's functions.php to change date format in PDF Vouchers.


Change {current_date} shortcode date format of title and file name in generated PDF and CSV

You can add this code snippet to a custom plugin or your theme's functions.php to change the date format at all those places where PDF/CSV is downloaded.


Change date format for product start date and end date on product edit page

You can add this code snippet to a custom plugin or your theme's functions.php to change date format of product start and end date on product edit page.


Add custom CSS on check QRcode page

You can add this code snippet to a custom plugin or your theme's functions.php to add custom CSS for check QRcode page.


Change font for generated PDF

To change font for generated PDF you can add this code snippet to a custom plugin or your child theme's functions.php by replacing 'freeserif' with a name of your font.

Note: Note: Template will support TCPDF supported fonts. Don't worry, if you don't have TCPDF supported fonts. You can simply convert the fonts to TCPDF supported fonts from here.

Modify the preview text and popup title on single product page

You can add this code snippet to a custom plugin or your theme's functions.php to change preview text and popup title.


Modify Admin Email while Customer Processing, Customer Completed and Gift Notification Email are sent.

You can add this code snippet to a custom plugin or your theme's functions.php.


Update vendor role title. Default title is Voucher Vendor

You can add this code snippet to a custom plugin or your theme's functions.php.


Display all public order items meta in pdf voucher

For example you if you want to show the information as mention in below screenshot to the pdf voucher.


You need to add shortcode called {order_items_meta} in voucher template. Once you add shortcode then add following code to a custom plugin or your theme's functions.php.

Once you add the code, information in the pdf voucher will look as below screenshot.