Developer Guide Documentation
To Change the Invoice Column and row lable.
// Change the column title of Serial number(#)
add_filter( 'pdf_template_serial_number_text', 'change_pdf_template_serial_number_text' );
Example:
add_filter( 'pdf_template_serial_number_text', 'change_pdf_template_serial_number_text' );
function change_pdf_template_serial_number_text() {
return '#';
}
// Change the column title of Item
add_filter( 'pdf_template_item_text', 'change_pdf_template_item_text' );
Example:
add_filter( 'pdf_template_item_text', 'change_pdf_template_item_text' );
function change_pdf_template_item_text() {
return 'Item';
}
// Change the column title of Quantity
add_filter( 'pdf_template_quantity_text', 'change_pdf_template_quantity_text' );
Example:
add_filter( 'pdf_template_quantity_text', 'change_pdf_template_quantity_text' );
function change_pdf_template_quantity_text() {
return 'QTY';
}
// Change the column title of Rate Per Item
add_filter( 'pdf_template_rate_per_item_text', 'change_pdf_template_rate_per_item_text' );
Example:
add_filter( 'pdf_template_rate_per_item_text', 'change_pdf_template_rate_per_item_text' );
function change_pdf_template_rate_per_item_text() {
return 'Rate Per Item (Rs.)';
}
// Change the column title of Discount Item
add_filter( 'pdf_template_discount_item_text', 'change_pdf_template_discount_item_text' );
Example:
add_filter( 'pdf_template_discount_item_text', 'change_pdf_template_discount_item_text' );
function change_pdf_template_discount_item_text() {
return 'Discount Item';
}
// Change the column title of Taxable Item
add_filter( 'pdf_template_taxable_item_text', 'change_pdf_template_taxable_item_text' );
Example:
add_filter( 'pdf_template_taxable_item_text', 'change_pdf_template_taxable_item_text' );
function change_pdf_template_taxable_item_text() {
return 'Taxable Item (Rs.)';
}
// Change the column title of HSN
add_filter( 'pdf_template_hsn_text', 'change_pdf_template_hsn_text' );
Example:
add_filter( 'pdf_template_hsn_text', 'change_pdf_template_hsn_text' );
function change_pdf_template_hsn_text() {
return 'HSN';
}
// Change the column title of GST
add_filter( 'pdf_template_gst_text', 'change_pdf_template_gst_text' );
Example:
add_filter( 'pdf_template_gst_text', 'change_pdf_template_gst_text' );
function change_pdf_template_gst_text() {
return 'GST %';
}
// Change the column title of CGST
add_filter( 'pdf_template_cgst_text', 'change_pdf_template_cgst_text' );
Example:
add_filter( 'pdf_template_cgst_text', 'change_pdf_template_cgst_text' );
function change_pdf_template_cgst_text() {
return 'CGST Rs.';
}
// Change the column title of SGST
add_filter( 'pdf_template_sgst_text', 'change_pdf_template_sgst_text' );
Example:
add_filter( 'pdf_template_sgst_text', 'change_pdf_template_sgst_text' );
function change_pdf_template_sgst_text() {
return 'SGST Rs.';
}
// Change the column title of IGST
add_filter( 'pdf_template_igst_text', 'change_pdf_template_igst_text' );
Example:
add_filter( 'pdf_template_igst_text', 'change_pdf_template_igst_text' );
function change_pdf_template_igst_text() {
return 'IGST Rs.';
}
// Change the column title of column Total
add_filter( 'pdf_template_column_total_text', 'change_pdf_template_column_total_text' );
Example:
add_filter( 'pdf_template_column_total_text', 'change_pdf_template_column_total_text' );
function change_pdf_template_column_total_text() {
return 'Total Rs.';
}
// Change Terms and Conditions title
add_filter( 'pdf_template_tnc_title', 'change_pdf_template_tnc_title' );
Example:
add_filter( 'pdf_template_tnc_title', 'change_pdf_template_tnc_title' );
function change_pdf_template_tnc_title() {
return 'Terms and Conditions';
}
// Change Final total title
add_filter( 'pdf_template_final_amt_title', 'change_pdf_template_final_amt_title' );
Example:
add_filter( 'pdf_template_final_amt_title', 'change_pdf_template_final_amt_title' );
function change_pdf_template_final_amt_title() {
return 'Total';
}
To remove invoice field.
// Remove ORIGINAL text
add_filter( 'pdf_template_remove_original_text', 'change_pdf_template_remove_original_text' );
Example:
add_filter( 'pdf_template_remove_original_text', 'change_pdf_template_remove_original_text', );
function change_pdf_template_remove_original_text( $show_original_text ) {
return $show_original_text == true;
}
// Remove admin Email
add_filter( 'pdf_template_remove_admin_email', 'change_pdf_template_remove_admin_email' );
Example:
add_filter( 'pdf_template_remove_admin_email', 'change_pdf_template_remove_admin_email' );
function change_pdf_template_remove_admin_email( $display_admin_email ) {
return $display_admin_email == true;
}
// Remove site url
add_filter( 'pdf_template_remove_site_url', 'change_pdf_template_remove_site_url' );
Example:
add_filter( 'pdf_template_remove_site_url', 'change_pdf_template_remove_site_url' );
function change_pdf_template_remove_site_url( $display_site_url ) {
return $display_site_url == true;
}
// Remove phone number
add_filter( 'pdf_template_remove_phone_no', 'change_pdf_template_remove_phone_no' );
Example:
add_filter( 'pdf_template_remove_phone_no', 'change_pdf_template_remove_phone_no' );
function change_pdf_template_remove_phone_no( $display_phone_no ) {
return $display_phone_no == true;
}
To add a custom field in the invoice.
// Add custom meta field after product title
add_filter( 'woogst_product_metafield', 'change_invoice_metafield', 10, 4 );
Example:
add_filter( 'woogst_product_metafield', 'change_invoice_metafield', 10, 4 );
function change_invoice_metafield( $arr_meta_field, $product_id, $order_id, $item ) {
$hsn = get_post_meta( $product_id, 'hsn_prod_id', true );
$arr_meta_field['HSN Code'] = $hsn;
return $arr_meta_field;
}
// Add custom field after product title
add_filter( 'woogst_after_product_title', 'callback_handler', 10, 3 );
Example:
add_filter( 'woogst_after_product_title', 'pdf_template_after_product_title', 10, 3 );
function pdf_template_after_product_title( $string, $arg1, $arg2 ) {
$string = 'Limited Edition';
return $string;
}
// Add custom field after amount in word.
add_filter( 'pdf_after_amount_in_word', 'change_pdf_after_amount_in_word', 10, 3 );
Example:
add_filter( 'pdf_after_amount_in_word', 'change_pdf_after_amount_in_word', 10, 3 );
function change_pdf_after_amount_in_word( $string, $arg1, $arg2 ) {
$string = 'Custom note';
return $string;
}
// Add custom field in BILL TO PARTY after GSTIN no.
add_filter( 'pdf_bill_to_party_after_gstin_number', 'change_pdf_bill_to_party_after_gstin_number', 10, 3 );
Example:
add_filter( 'pdf_bill_to_party_after_gstin_number', 'change_pdf_bill_to_party_after_gstin_number', 10, 3 );
function change_pdf_bill_to_party_after_gstin_number( $string, $arg1, $arg2 ) {
$string = 'Custom note';
return $string;
}
// Add custom field in SHIP TO PARTY after GSTIN no.
add_filter( 'pdf_ship_to_party_after_gstin_number', 'change_pdf_ship_to_party_after_gstin_number', 10, 3 );
Example:
add_filter( 'pdf_ship_to_party_after_gstin_number', 'change_pdf_ship_to_party_after_gstin_number', 10, 3 );
function change_pdf_ship_to_party_after_gstin_number( $string, $arg1, $arg2 ) {
$custom_note = 'Ship Limited Edition';
return $custom_note;
}
// Add custom email to Invoice
add_filter( 'pdf_template_admin_email', 'change_pdf_template_admin_email' );
Example:
add_filter( 'pdf_template_admin_email', 'change_pdf_template_admin_email' );
function change_pdf_template_admin_email() {
return 'test@gmail.com';
}