Home / Topic / WCMp PDF Invoice / display the customer’s telephone number on the invoice and the delivery note
display the customer’s telephone number on the invoice and the delivery note Resolved
I wish to display the customer’s telephone number on the invoice and the delivery note.
help me
hi, for display the customer’s telephone number on the delivery note you have to override wcmp-pdf_invoices/templates/wcmp_packing_slip_first_template.php template by copying it to yourtheme/wcmp-pdf-invoices/wcmp_packing_slip_first_template.php.
add this code after line no 49
<?php $billing_phone = get_post_meta( $order->get_id(), '_billing_phone', true );
if(!empty($billing_phone)){?>
<p class="invoice-text"><strong><?php _e('Phone No:', 'wcmp-pdf_invoices'); ?></strong></p>
<p><?php echo $billing_phone; ?></p>
<?php } ?>
Copy
for invoice
please add this code in the function.php of the current active theme :
add_action('after_wcmp_pdf_invoice_to_address_details','wcmp_pdf_invoice_add_customer_ph_no_on_customer_invoice');
function wcmp_pdf_invoice_add_customer_ph_no_on_customer_invoice($hook_data){
$order=$hook_data['order'];
$billing_phone = get_post_meta( $order->get_id(), '_billing_phone', true );
if(!empty($billing_phone)){?>
<p class="invoice-text"><?php _e('Phone No:', 'wcmp-pdf_invoices'); ?></p>
<p><?php echo $billing_phone; ?></p>
<?php
}
}
Copy
How to display the seller’s name on the invoice and delivery note.
Hi,
using below code you can get the seller’s shop title on the invoice.
Modify this code as per your requirement.
Add this code of the function.php of your active theme.
add_action('after_wcmp_pdf_invoice_to_address_details','wcmp_pdf_invoice_add_vendor_name_customer_invoice', 20);
function wcmp_pdf_invoice_add_vendor_name_customer_invoice($hook_data){
$order=$hook_data['order'];
$suborders = get_wcmp_suborders( $order->get_id(), $args = array(), false );
if(!empty($suborders)){
foreach ($suborders as $id ) {
$vendor_id = get_post_meta( $id, '_vendor_id', true);
$vendor = get_wcmp_vendor( $vendor_id );
?>
<p class="invoice-text"><?php _e('vendor:', 'wcmp-pdf_invoices'); ?></p>
<p><?php echo $vendor->page_title; ?></p>
<?php
}
}else{
$vendor_id = get_post_meta( $order->get_id(), '_vendor_id', true);
$vendor = get_wcmp_vendor( $vendor_id );
?>
<p class="invoice-text"><?php _e('vendor:', 'wcmp-pdf_invoices'); ?></p>
<p><?php echo $vendor->page_title; ?></p>
<?php
}
}
Copy
Please follow the same coding style for the delivery note.
Regards,
We have not received any update from you for a long. Hope this ticket is already been resolved.
We are now closing this ticket. Kindly create a new one if you need any further help.
The topic ‘display the customer’s telephone number on the invoice and the delivery note’ is closed to new replies.