@almaespinosa,
Could you try this?
add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_residential_area', 10, 2 );
function wpo_wcpdf_residential_area( $template_type, $order ) {
// if order is empty, bail
if ( empty($order) ) { return; }
?>
<tr class="residential-area">
<th>Residential Area: </th>
<td><?php echo $order->get_meta('area_residencial'); ?></td>
</tr>
<tr class="residential-area-2">
<th>Residential Area 2: </th>
<td><?php echo $order->get_meta('area_residencial_2'); ?></td>
</tr>
<?php
}
If you haven’t used hooks before, check this guide out: https://docs.wpovernight.com/general/how-to-use-filters/
Adding custom fields is much easier with the Premium Templates extension of our plugin, thanks to Custom blocks provided by the Customizer, so it could easily eliminate the need for additional code:

-
This reply was modified 3 years, 11 months ago by
Darren Peyou.
-
This reply was modified 3 years, 11 months ago by
Darren Peyou.