Can’t add Local Pickup Plus custom field to wpo_wcpdf_after_shipping_address

[ad_1]

I’ve added the following code to the template-functions.php as per documentation for my invoice:

add_action( 'wpo_wcpdf_after_shipping_address', 'wpo_wcpdf_location_name', 10, 2 );
function wpo_wcpdf_location_name ($template_type, $order) {
        ?>
        <tr class="location-name">
            <th>Pickup Location:</th>
            <td><?php echo $order->get_meta('_pickup_location_name'); ?></td>
        </tr>
    <?php
}

And I’ve got my invoice set to HTML to view the render faster. But nothing is displayed – not even the ‘Pickup Location’ text.

But if I changed the hook to ‘wpo_wcpdf_before_customer_notes’ I can see the text at least. While custom field value is still not loading.

Is there something else I’m missing?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer