New action hook
-
Hi Guys
I am trying to add more info to the invoice layout I have managed to get the required_date (extra filed) added in to the invoice under the order date. However I am trying to get it located afte the order_comments field (this is an extra woocommerce field set in woocommerce after shipping details.This is what i have that works after order date at the top of the invoice
add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_required_date', 10, 2 ); function wpo_wcpdf_required_date ($template_type, $order) { if ($template_type == 'invoice') { ?> <tr class="delivery-date"> <th>Required Date:</th> <td><?php echo $order->get_meta('required_date'); ?></td> </tr> <?php } }However when i try this to go further down the invoice after order_details it tells me there is a problem on the site and does not work
add_action( 'wpo_wcpdf_after_order_comments', 'wpo_wcpdf_required_date', 10, 2 ); function wpo_wcpdf_required_date ($template_type, $order) { if ($template_type == 'invoice') { ?> <tr class="delivery-date"> <th>Required Date:</th> <td><?php echo $order->get_meta('required_date'); ?></td> </tr> <?php } }- This topic was modified 6 years, 8 months ago by .
- This topic was modified 6 years, 8 months ago by .
- This topic was modified 6 years, 8 months ago by .
- This topic was modified 6 years, 8 months ago by .
The page I need help with: [log in to see the link]
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
The topic ‘New action hook’ is closed to new replies.