Title: _billing_CF
Last modified: March 1, 2018

---

# _billing_CF

 *  Resolved [carlotoscani](https://wordpress.org/support/users/carlotoscani/)
 * (@carlotoscani)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/_billing_cf/)
 * Hi,
    How can I add to invoice the “_billing_CF” variable? Which file I have to
   change? It is the CODICE FISCALE for Italian customer? Thanks a lot Carlo

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/_billing_cf/#post-10031019)
 * Hello Carlo,
    You can find all the information you need for this in the documentation:
   [Displaying a custom field](http://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/displaying-a-custom-field/).
 * Let us know if you have any other questions!
    Ewout
 *  Thread Starter [carlotoscani](https://wordpress.org/support/users/carlotoscani/)
 * (@carlotoscani)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/_billing_cf/#post-10031256)
 * Hello Ewout,
    thanks for your fast replay, but it is works only if put after “
   billing-phone”, in other position I mean in other row doesn’t work.
 * <td class=”address billing-address”>
    <!– <h3><?php _e( ‘Billing Address:’, ‘
   woocommerce-pdf-invoices-packing-slips’ ); ?></h3> –> <?php $this->billing_address();?
   > <?php if ( isset($this->settings[‘display_email’]) ) { ?> <div class=”billing-
   email”><?php $this->billing_email(); ?></div> <?php } ?> <?php if ( isset($this-
   >settings[‘display_phone’]) ) { ?> <div class=”billing-phone”><b>Telefono:<?php
   $this->billing_phone(); ?></b></div> <div class=”custom_field”>COD.FISC.:<?php
   $this->custom_field(‘_billing_CF’); ?></div>
 *  <?php } ?>
    </td>
    -  This reply was modified 8 years, 3 months ago by [carlotoscani](https://wordpress.org/support/users/carlotoscani/).
 *  Plugin Contributor [kluver](https://wordpress.org/support/users/kluver/)
 * (@kluver)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/_billing_cf/#post-10031697)
 * Hi [@carlotoscani](https://wordpress.org/support/users/carlotoscani/),
 * That is strange, it should work in any position. Are you getting a specific error
   back when you set it up in a different position?
 * With kind regards,
 * Michael
 *  Thread Starter [carlotoscani](https://wordpress.org/support/users/carlotoscani/)
 * (@carlotoscani)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/_billing_cf/#post-10031829)
 * I don’t see it, no error
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/_billing_cf/#post-10032747)
 * can you share the code that doesn’t work so we can look at it?
 * If you put it in backticks (click the ‘code’ button in the forum post editor,
   then a line break, then the code, another line break and then click the ‘/code’
   button), it will be formatted properly in the forums here.
 *  Thread Starter [carlotoscani](https://wordpress.org/support/users/carlotoscani/)
 * (@carlotoscani)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/_billing_cf/#post-10032906)
 *     ```
       <?php do_action( 'wpo_wcpdf_before_document', $this->type, $this->order ); ?>
   
       <table class="head container">
       	<tr>
       		<td class="header">
       		<?php
       		if( $this->has_header_logo() ) {
       			$this->header_logo();
       		} else {
       			echo apply_filters( 'wpo_wcpdf_invoice_title', __( 'Ricevuta Fiscale', 'woocommerce-pdf-invoices-packing-slips' ) );
       		}
       		?>
       		</td>
       		<td class="shop-info">
       			<div class="shop-name"><h3><?php $this->shop_name(); ?></h3></div>
       			<div class="shop-address"><?php $this->shop_address(); ?></div>
       		</td>
       	</tr>
       </table>
   
       <h1 class="document-type-label">
       <?php if( $this->has_header_logo() ) echo apply_filters( 'wpo_wcpdf_invoice_title', __( 'Ricevuta Fiscale', 'woocommerce-pdf-invoices-packing-slips' ) ); ?>
       </h1>
   
       <?php do_action( 'wpo_wcpdf_after_document_label', $this->type, $this->order ); ?>
   
       <table class="order-data-addresses">
       	<tr>
       		<td class="address billing-address">
       			<!-- <h3><?php _e( 'Billing Address:', 'woocommerce-pdf-invoices-packing-slips' ); ?></h3> -->
       			<?php $this->billing_address(); ?>
       			<?php if ( isset($this->settings['display_email']) ) { ?>
       			<div class="billing-email"><?php $this->billing_email(); ?></div>
       			<?php } ?>
       			<?php if ( isset($this->settings['display_phone']) ) { ?>
       			<div class="billing-phone"><b>Telefono:<?php $this->billing_phone(); ?></b></div>
       				<div class="custom_field">COD.FISC.:<?php $this->custom_field('_billing_CF'); ?></div>
   
       			<?php } ?>
       		</td>
       		<td class="address shipping-address">
       			<?php if ( isset($this->settings['display_shipping_address']) && $this->ships_to_different_address()) { ?>
       			<table><tr><td style="border: 2px solid green; padding: 5px;"><h3><?php _e( 'Ship To:', 'woocommerce-pdf-invoices-packing-slips' ); ?></h3>
       			<b><?php $this->shipping_address(); ?></b></td></tr></table>
       			<?php } ?>
       		</td>
       		<td class="order-data">
       			<table>
       				<?php do_action( 'wpo_wcpdf_before_order_data', $this->type, $this->order ); ?>
       				<?php if ( isset($this->settings['display_number']) ) { ?>
       				<tr class="invoice-number">
       					<th><?php _e( 'Ricevuta Fiscale N.:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
       					<td><b><?php $this->invoice_number(); ?></b></td>
       				</tr>
       				<?php } ?>
       				<?php if ( isset($this->settings['display_date']) ) { ?>
       				<tr class="invoice-date">
       					<th><?php _e( 'Data Ricevuta Fiscale:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
       					<td><?php $this->invoice_date(); ?></td>
       				</tr>
       				<?php } ?>
       				<tr class="order-number">
       					<th><?php _e( 'Order Number:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
       					<td><?php $this->order_number(); ?></td>
       				</tr>
       				<tr class="order-date">
       					<th><?php _e( 'Order Date:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
       					<td><?php $this->order_date(); ?></td>
       				</tr>
       				<tr class="payment-method">
       					<th><?php _e( 'Payment Method:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
       					<td><?php $this->payment_method(); ?></td>
       				</tr>
       				<?php do_action( 'wpo_wcpdf_after_order_data', $this->type, $this->order ); ?>
       			</table>			
       		</td>
       	</tr>
       </table>
   
       <?php do_action( 'wpo_wcpdf_before_order_details', $this->type, $this->order ); ?>
   
       <table class="order-details">
       	<thead>
       		<tr>
       			<th class="product"><?php _e('Product', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
       			<th class="quantity"><?php _e('Quantity', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
       			<th class="price"><?php _e('Price', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
       		</tr>
       	</thead>
       	<tbody>
       		<?php $items = $this->get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item_id => $item ) : ?>
       		<tr class="<?php echo apply_filters( 'wpo_wcpdf_item_row_class', $item_id, $this->type, $this->order, $item_id ); ?>">
       			<td class="product">
       				<?php $description_label = __( 'Description', 'woocommerce-pdf-invoices-packing-slips' ); // registering alternate label translation ?>
       				<span class="item-name"><?php echo $item['name']; ?></span>
       				<?php do_action( 'wpo_wcpdf_before_item_meta', $this->type, $item, $this->order  ); ?>
       				<span class="item-meta"><?php echo $item['meta']; ?></span>
       				<dl class="meta">
       					<?php $description_label = __( 'SKU', 'woocommerce-pdf-invoices-packing-slips' ); // registering alternate label translation ?>
       					<?php if( !empty( $item['sku'] ) ) : ?><dt class="sku"><?php _e( 'SKU:', 'woocommerce-pdf-invoices-packing-slips' ); ?></dt><dd class="sku"><?php echo $item['sku']; ?></dd><?php endif; ?>
       					<?php if( !empty( $item['weight'] ) ) : ?><dt class="weight"><?php _e( 'Weight:', 'woocommerce-pdf-invoices-packing-slips' ); ?></dt><dd class="weight"><?php echo $item['weight']; ?><?php echo get_option('woocommerce_weight_unit'); ?></dd><?php endif; ?>
       				</dl>
       				<?php do_action( 'wpo_wcpdf_after_item_meta', $this->type, $item, $this->order  ); ?>
       			</td>
       			<td class="quantity"><?php echo $item['quantity']; ?></td>
       			<td class="price"><?php echo $item['order_price']; ?></td>
       		</tr>
       		<?php endforeach; endif; ?>
       	</tbody>
       	<tfoot>
       		<tr class="no-borders">
       			<td class="no-borders">
       				<div class="customer-notes">
       					<?php do_action( 'wpo_wcpdf_before_customer_notes', $this->type, $this->order ); ?>
       					<?php if ( $this->get_shipping_notes() ) : ?>
       						<h3><?php _e( 'Customer Notes', 'woocommerce-pdf-invoices-packing-slips' ); ?></h3>
       						<?php $this->shipping_notes(); ?>
       					<?php endif; ?>
       					<?php do_action( 'wpo_wcpdf_after_customer_notes', $this->type, $this->order ); ?>
       				</div>				
       			</td>
       			<td class="no-borders" colspan="2">
       				<table class="totals">
       					<tfoot>
       						<?php foreach( $this->get_woocommerce_totals() as $key => $total ) : ?>
       						<tr class="<?php echo $key; ?>">
       							<td class="no-borders"></td>
       							<th class="description"><?php echo $total['label']; ?></th>
       							<td class="price"><span class="totals-price"><?php echo $total['value']; ?></span></td>
       						</tr>
       						<?php endforeach; ?>
       					</tfoot>
       				</table>
       			</td>
       		</tr>
       	</tfoot>
       </table>
   
       <?php do_action( 'wpo_wcpdf_after_order_details', $this->type, $this->order ); ?>
   
       <?php if ( $this->get_footer() ): ?>
       <div id="footer">
       	<?php $this->footer(); ?>
       </div><!-- #letter-footer -->
       <?php endif; ?>
       <?php do_action( 'wpo_wcpdf_after_document', $this->type, $this->order ); ?>
       ```
   
 *  Thread Starter [carlotoscani](https://wordpress.org/support/users/carlotoscani/)
 * (@carlotoscani)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/_billing_cf/#post-10032907)
 * thanks a lot for your support!
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/_billing_cf/#post-10033534)
 * I see what happened: you put this in the check for whether you have enabled the
   phone number (which I guess you haven’t?):
 *     ```
       <?php if ( isset($this->settings['display_phone']) ) { ?>
       ... this only displays if you have enabled "Display phone number"
       <?php } ?>
       ```
   
 * If you put it outside of the if statement, it will work regardless of the setting:
 *     ```
       <?php if ( isset($this->settings['display_phone']) ) { ?>
       <div class="billing-phone"><b>Telefono:<?php $this->billing_phone(); ?></b></div>
       <?php } ?>
       <div class="custom_field">COD.FISC.:<?php $this->custom_field('_billing_CF'); ?></div>
       ```
   
 * Hope that helps!
    Ewout
 *  Thread Starter [carlotoscani](https://wordpress.org/support/users/carlotoscani/)
 * (@carlotoscani)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/_billing_cf/#post-10053951)
 * Thanks a lot , it’s works fine!
    I rated your plugin 5 stars. Best regards Carlo

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘_billing_CF’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

## Tags

 * [codice fiscale](https://wordpress.org/support/topic-tag/codice-fiscale/)
 * [custom field](https://wordpress.org/support/topic-tag/custom-field/)

 * 9 replies
 * 3 participants
 * Last reply from: [carlotoscani](https://wordpress.org/support/users/carlotoscani/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/_billing_cf/#post-10053951)
 * Status: resolved