Plugin Settings Database
Note: This document is written for WooCommerce developers looking to extend or customize WooCommerce Pdf Vouchers. It requires an advanced understanding of PHP and WordPress development.
WooCommerce PDF Vouchers store all settings data to WordPress Options table. it stores the data in a key and value pair as other settings of the WordPress.
WooCommerce PDF Vouchers stores few data in Custom post type like Voucher templates and Voucher codes. The database schema for voucher codes includes voucher dates, voucher code,order id, order date and many others.
General Settings
OPTION KEY | DATA TYPE | VALUE DESCRIPTION |
vou_enable_partial_redeem | String | Enable or Disable Partial Redemption Values: yes, no |
vou_partial_redeem_product_ids | String | Store Partial Redemption Product Ids |
vou_enable_coupon_code | String | Enable or Disable Coupon Code Generation Values: yes, no |
vou_enable_voucher_preview | String | Enable or Disable Voucher Preview on product detail page before placing the order. Values: yes, no |
vou_enable_voucher_preview_open_option | String | Store Type of Voucher Preview. Values: popup, newtab |
vou_preview_image | String | Store watermark image use in PDF generate preview. |
vou_pdf_name | String | Store the PDF name to download with the file name, while generating a PDF of voucher codes file. |
vou_pdf_title | String | Store the PDF title used as a title, while generating a PDF of voucher codes file. |
vou_pdf_author | String | Store the PDF author name used as a author name, while generating a PDF of voucher codes file. |
vou_pdf_creator | String | Store the PDF creator name used as a creator name, while generating a PDF of voucher codes file. |
vou_csv_name | String | Store the CSV file name that you want to use while generating a CSV of unredeemed voucher codes. |
order_pdf_name | String | Store the PDF file name that you want to use while users download a PDF of voucher codes on frontend. |
attach_pdf_name | String | Store the PDF file name that you want to use while users download a PDF of voucher codes from email attachment. |
vou_recipient_form_position | String | It controls the position of the Recipient Form. |
vou_custom_css | String | Store your custom CSS for the PDF vouchers. The CSS will be automatically added to the header, when you save it. |
Voucher Settings
OPTION KEY | DATA TYPE | VALUE DESCRIPTION |
vou_site_logo | String | Here you can upload a logo of your site. This logo will be displayed on the voucher as the Site Logo. |
vou_pdf_template | String | Select a PDF template. |
vou_pdf_usability | String | Choose how you wanted to use vouchers codes. Allow to one time only or unlimited times. Values: 0, 1 |
multiple_pdf | String | Generate 1 PDF for 1 voucher code instead of creating 1 combined PDF for all vouchers. Values: yes , no |
revoke_voucher_download_link_access | String | Remove voucher download link, when voucher is used or expired. Values: yes , no |
vou_change_expiry_date | String | Allow admin/vendors to change voucher expiry date when voucher is unredeemed or expired from voucher code page. |
vou_change_template | String | Allow admin/vendors to change voucher template when voucher is unredeemed, redeemed or expired from voucher code details page. Values: yes , no |
vou_attach_processing_mail | String | Send voucher PDF as attachment in processing / completed order email. Values: yes , no |
vou_attach_gift_mail | String | Send voucher PDF as attachment in gift notification email. Values: yes , no |
vou_download_processing_mail | String | Allow Voucher to download from processing / completed order mail and order thank you page. Values: yes , no |
vou_download_dashboard | String | Allow voucher to download from dashboard -> Downloads page. Values: yes , no |
vou_allow_redeem_expired_voucher | String | Allow redeem voucher codes after expiration date. Values: yes , no |
vou_allow_unlimited_redeem_vou_code | String | Allow users to redeem same voucher code unlimited times. Values: yes , no |
vou_allow_unlimited_limit_vou_code | String | Sets the number of times the same voucher code can be used. |
vou_enable_logged_user_check_voucher_code | String | Allow logged in users to access check voucher code page and voucher codes report pages. Values: yes , no |
vou_enable_guest_user_check_voucher_code | String | Allow guest users to access check voucher code page. Values: yes , no |
woo_vou_guest_user_allow_redeem_voucher | String | Allow redemption of purchased vouchers for guest users. Values: yes , no |
vou_enable_permission_vou_download_recipient_user | String | Allow Direct Access from Downloads Page. Values: yes , no |
vou_voucher_price_options | String | This option determines default voucher value, based on Sale Price, Regular Price or Custom Voucher Price. Values: blank, 1, 2 |
vou_voucher_delivery_options | String | Default Voucher expiration type, on specific type or based on purchase. Values: email , offline |
vou_days_diff | String | Default Voucher expiration days after it purchased. |
vou_allow_bcc_to_admin | String | Send customer order email and gift notification email to admin. Values: yes , no |
Misc Settings
OPTION KEY | DATA TYPE | VALUE DESCRIPTION |
vou_delete_options | String | It determines that you do not want to use this plugin in your website anymore and all settings and tables are deleted from database. |
vou_char_support | String | Enable characters support which are not displaying correctly for e.g. Greek characters. Values: yes , no |
vou_enable_preview_in_browser | String | Allow admin to preview voucher template in a browser instead of downloading the pdf from the backend. Values: yes , no |
vou_enable_pdf_password_protected | String | Enable PDF voucher with password protection. Values: yes , no |
vou_pdf_password_pattern | String | Store password for voucher PDF file. |
vou_enable_relative_path | String | Use a relative path instead of absolute path for loading images in voucher pdf. Values: yes , no |
vou_enable_vendor_access_all_voucodes | String | Allow vendors to access all voucher codes. Values: yes , no |
vou_disable_vendor_access_voucher_template | String | Disallow vendors to access voucher template page. Values: yes , no |
vou_allow_secondary_vendor_redeem_primary_voucher | String | Allow secondary vendor user(s) to redeem their own voucher code. Values: yes , no |
vou_allow_recipient_to_get_voucher_info | String | Allow only the recipient to get voucher information and disable for customer. Customer who have ordered will not get voucher information. Values: yes , no |
vou_disable_variations_auto_downloadable | String | Disable vendor option tick all variation as downloadable when we “Enable Voucher Codes” at the product level. Values: yes , no |
vou_enable_voucher | String | Automatically “Enable Voucher Codes” when product is set as Downloadable. Values: yes , no |
vou_vendor_default_logo | String | This logo will be displayed on the voucher template preview as vendor logo. |
vou_download_text | String | Voucher Download link text, while generating PDF. |
vou_code_postfix | String | Numeric value which will automatically get succeeded at the end of voucher code when usability is set as unlimited. |
vou_gift_notification_time | String | The time when gift notification email will be send. |
vou_pdf_delete_time | String | Time range at which the voucher’s PDF file will get deleted. Values: hourly , daily , twicedaily |
Product Metabox Data
WooCommerce created custom post type for Product which is used to store product data. WooCommerce PDF Vouchers use postmeta
table to store product level data
General Meta Data
OPTION KEY | DATA TYPE | VALUE DESCRIPTION |
_woo_vou_enable | String | Enable the voucher code for the product. |
_woo_vou_product_start_date | String | Allow voucher code start from this specific time only. |
_woo_vou_product_exp_date | String | Disallow voucher code for this from this specifica time. |
_woo_vou_voucher_delivery | String | The delivery method for the customer that how they will received. Values: default , email , offline |
_woo_vou_enable_pdf_preview | String | Allow / Disallow voucher code preview on product detail page. Values: Default , yes , no |
_woo_vou_enable_coupon_code | String | Allow / Disallow coupon code generation while voucher code generated. Values: Default , yes , no |
_woo_vou_enable_multiple_pdf | String | Generate 1 PDF for 1 voucher code. Values: Default , yes , no |
_woo_vou_using_type | String | Usability of voucher codes. Values: blank , 0 , 1 |
_woo_vou_codes | String | List of voucher codes, comma cu values. |
_woo_vou_exp_type | String | Expiration types of voucher codes. Values: default , specific_date , based_on_purchase , based_on_gift_date |
_woo_vou_start_date | String | Voucher code expiration start date for specific time type of expiration. |
_woo_vou_days_diff | String | Expiration days difference for expiration type based on purchase data and base on recipient Gift date. Values: 7 , 15 , 30 , 90 , 180 , 365 , cust |
_woo_vou_custom_days | String | Expiration days difference for custom option. |
_woo_vou_disable_redeem_day | String | Restrict use of voucher code on specific days. Values: Monday , Tuesday , Wednesday , Thursday , Friday , Saturday , Sunday |
Vendor Meta Data
OPTION KEY | DATA TYPE | VALUE DESCRIPTION |
_woo_vou_vendor_user | String | Store primary vendor user. |
_woo_vou_sec_vendor_users | Serialize | Store secondary vendor users, here you store multiple vendors. |
_woo_vou_logo | Serialize | Store vendor logo to display on voucher PDF file. |
_woo_vou_address_phone | String | Store vendor address to display on voucher PDF file. |
_woo_vou_website | String | Store vendor website to display on voucher PDF file. |
_woo_vou_how_to_use | String | Store redeem instructions to display on voucher PDF file. |
_woo_vou_locations | Serialize | Store vendor locations and location map links, can be store multiple values. |
Gift Voucher Meta Data
OPTION KEY | DATA TYPE | VALUE DESCRIPTION |
_woo_vou_enable_recipient_name | String | Enable / Disable recipient name field on gift voucher form on product page. |
_woo_vou_recipient_name_label | String | Recipient name field label. |
_woo_vou_recipient_name_max_length | String | Recipient name field max length. |
_woo_vou_recipient_name_is_required | String | Recipient name field required validation enable or disable. |
_woo_vou_recipient_name_desc | String | Recipient name field description. |
_woo_vou_enable_recipient_email | String | Enable / Disable recipient email field on gift voucher form on product page. |
_woo_vou_recipient_email_label | String | Recipient email field label. |
_woo_vou_recipient_email_is_required | String | Recipient email field required validation enable or disable. |
_woo_vou_recipient_email_desc | String | Recipient email field description. |
_woo_vou_enable_recipient_message | String | Enable / Disable recipient message field on gift voucher form on product page. |
_woo_vou_recipient_message_label | String | Recipient message field label. |
_woo_vou_recipient_message_max_length | String | Recipient message field max length. |
_woo_vou_recipient_message_is_required | String | Recipient message field required validation enable or disable. |
_woo_vou_recipient_message_desc | String | Recipient message field description. |
_woo_vou_enable_recipient_giftdate | String | Enable / Disable recipient gift date field on gift voucher form on product page. |
_woo_vou_recipient_giftdate_label | String | Recipient gift date field label. |
_woo_vou_recipient_giftdate_is_required | String | Recipient gift date field required validation enable or disable. |
_woo_vou_recipient_giftdate_desc | String | Recipient gift date field description. |
_woo_vou_enable_recipient_phone | String | Enable / Disable recipient phone field on gift voucher form on product page. |
_woo_vou_recipient_phone_label | String | Recipient phone field label. |
_woo_vou_enable_recipient_delivery_method | String | Enable / Disable recipient delivery method field on gift voucher form on product page. |
_woo_vou_recipient_delivery_label | String | Recipient delivery method field label. |
_woo_vou_recipient_delivery[enable_email] | Serialize | Enable / Disable recipient delivery method email field on gift voucher form on product page. |
_woo_vou_recipient_delivery[label_email] | Serialize | Recipient delivery method email field label. |
_woo_vou_recipient_delivery[desc_email] | Serialize | Recipient delivery method email field description. |
_woo_vou_recipient_delivery[email][] | Serialize | Email to recipient block fields. Values: Recipient Name , Recipient Email , Recipient Message , Recipient Gift Date , Recipient Phone |
_woo_vou_recipient_delivery[enable_offline] | Serialize | Enable / Disable recipient delivery method offline field block on gift voucher form on product page. |
_woo_vou_recipient_delivery[label_offline] | Serialize | Recipient delivery method offline field block label. |
_woo_vou_recipient_delivery[desc_offline] | Serialize | Recipient delivery method offline field block description. |
_woo_vou_recipient_delivery[offline][] | Serialize | Offline block fields. Values: Recipient Name , Recipient Email , Recipient Message , Recipient Gift Date , Recipient Phone |
Voucher Templates Meta Data
OPTION KEY | DATA TYPE | VALUE DESCRIPTION |
_woo_vou_enable_pdf_template_selection | String | Enable / Disable PDF voucher templates selection on product page form. Values: yes , no |
_woo_vou_pdf_template_selection_label | String | PDF voucher templates selection field label. |
_woo_vou_pdf_template_selection | Serialize | PDF voucher templates to allow select. |
_woo_vou_pdf_selection_desc | String | PDF voucher templates field description. |
Voucher Templates – Custom Post Type
WooCommerce PDF Vouchers created custom post type called Voucher Templates to store all data of Voucher Templates. it uses WordPress Post table to store main data and also WordPress Postmeta table to store other fields.
Voucher Templates Post Data
Voucher templates title and content is stored to the WordPress posts
table.
OPTION KEY | DATA TYPE | VALUE DESCRIPTION |
post_title | String | Title for voucher template. |
post_content | String | Content for voucher template. |
Voucher Templates Postmeta Data
Voucher templates meta data stored in postmeta
table.
OPTION KEY | DATA TYPE | VALUE DESCRIPTION |
_woo_vou_pdf_bg_style | String | Background style for voucher template. |
_woo_vou_pdf_bg_pattern | String | Background pattern for voucher template. |
_woo_vou_pdf_bg_img | Serialize | Background image for voucher template. |
_woo_vou_pdf_bg_color | String | Background color for voucher template. |
_woo_vou_pdf_view | String | Voucher template pdf view. Values: land , port |
_woo_vou_pdf_size | String | Voucher template pdf view. Values: A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 |
_woo_vou_pdf_margin_top | String | Margin top in pixel for PDF. |
_woo_vou_pdf_margin_bottom | String | Margin bottom in pixel for PDF. |
_woo_vou_pdf_margin_left | String | Margin left in pixel for PDF. |
_woo_vou_pdf_margin_right | String | Margin right in pixel for PDF. |
_woo_vou_pdf_custom_css | String | Custom CSS for the Voucher Template. |
Voucher Codes – Custom Post Type
It store the voucher data (either it’s unredeemed, redeemed or expired) with separate post type woovouchercodes
and store meta data in WordPress postmeta
table for purchase, used and expired voucher code.
OPTION KEY | DATA TYPE | VALUE DESCRIPTION |
_woo_vou_first_name | String | Store first name, of the user who purchased the voucher. |
_woo_vou_last_name | String | Store last name, of the user who purchased the voucher. |
_woo_vou_order_id | String | Store the order id, on which order the voucher get purchased. |
_woo_vou_order_date | String | Store the order date, on which order get completed. |
_woo_vou_start_date | String | Store the start date for the voucher, so the voucher can be use on or after the start date. |
_woo_vou_exp_date | String | Store the expiry date for the voucher, so the voucher can’t be use after the expiry date. |
_woo_vou_disable_redeem_day | Serialize | Store the days on which days the voucher will can’t be redeem. |
_woo_vou_purchased_codes | String | Store the actual voucher code which is generated after the purchase. |
_woo_vou_sec_vendor_users | String | Store the secondary vendors user ids. Who can have access for the generated voucher code. |
_woo_vou_customer_user | String | Store ID of customer who have make an order. |
_woo_vou_used_codes | String | Store the actual voucher code which are get redeemed or used. |
Cart & Order Item Data
To store all fields data which is display on product page, WooCommerce PDF Voucher use WooCommerce item meta. It stores recipient data and voucher template data as car item meta data. These data will be stored in woocommerce_order_itemmeta
table.
Cart Item Data
OPTION KEY | DATA TYPE | VALUE DESCRIPTION |
_woo_vou_recipient_name | Serialize | Store recipient name, it store field details with label and value. |
_woo_vou_recipient_email | Serialize | Store recipient email, it store field details with label and value. |
_woo_vou_recipient_message | Serialize | Store recipient message, it store field details with label and value. |
_woo_vou_recipient_giftdate | Serialize | Store recipient gift date, it store field details with label and value. |
_woo_vou_recipient_phone | Serialize | Store recipient phone, it store field details with label and value. |
_woo_vou_voucher_price | String | Store recipient price. |
_woo_vou_delivery_method | Serialize | Store voucher coupon code delivery method. Values: offline , email |
_woo_vou_pdf_template_selection | Serialize | Store voucher PDF template type. |
_woo_vou_codes | String | Store voucher codes for the order item. |
_woo_vou_recipient_gift_email_send_item | String | Store the email status for gift voucher email is send or not to the recipient user. |
Order Data
WooCommerce PDF Voucher use the WooCommerce shop order custom post type for store the voucher meta data with the order. These data will be store in postmeta
table.
OPTION KEY | DATA TYPE | VALUE DESCRIPTION |
_woo_vou_multiple_pdf | Serialize | Store the value for voucher to generate voucher pdf as separate for each voucher code or need to generate single only. |
_woo_vou_meta_order_details | Serialize | Store all other voucher information including user email, pdf template, vendor logo, vendor address, voucher delivery method etc. to this meta in Serialize format. |
_woo_vou_recipient_email_sent | String | Store the status of recipient gift voucher email has been sent or not. |
Coupon Data
WooCommerce PDF Voucher use the WooCommerce Coupon custom post type to store the voucher meta data when Auto Coupon Code Generation option is enabled.
OPTION KEY | DATA TYPE | VALUE DESCRIPTION |
coupon_amount | String | Store the voucher coupon amount. It’s default WooCommerce meta. |
_woo_vou_start_date | String | Store the voucher coupon start date. |
date_expires | String | Store the voucher coupon expiry date. It’s default WooCommerce meta. |
_woo_vou_discount_on_tax_type | String | Store the voucher coupon discount type. |
_woo_vou_coupon_type | String | Store the coupon type as voucher coupon to identify that particular generated coupon is voucher coupon. |
minimum_amount | String | Store the voucher coupon minimum spend amount. It’s default WooCommerce meta. |
maximum_amount | String | Store the voucher coupon Maximum spend amount. It’s default WooCommerce meta. |
product_ids | Serialize | Store the product ids for the voucher coupon which are allow to apply for specific products only. It’s default WooCommerce meta. |
exclude_product_ids | Serialize | Store the product ids for the voucher coupon which are not allow to apply for specific products only. It’s default WooCommerce meta. |
| Serialize | Store the categories ids for the voucher coupon which are allow to apply for specific categories only. It’s default WooCommerce meta. |
exclude_product_categories | Serialize | Store the categories ids for the voucher coupon which are not allow to apply for specific categories only. It’s default WooCommerce meta. |
Product Data
Note: _woo_vou_product_start_date,_woo_vou_enable_pdf_preview,_woo_vou_enable_coupon_code,_woo_vou_codes,_woo_vou_enable_pdf_template_selection, _woo_vou_coupon_products,_woo_vou_coupon_exclude_products,_woo_vou_coupon_categories,_woo_vou_coupon_exclude_categories, _woo_vou_coupon_minimum_spend_amount, _woo_vou_coupon_maximum_spend_amount
Above list of product meta data, plugin doesn’t store in WooCommerce order. Plugin directly fetch from the product itself.