• Resolved martijnswolfs

    (@martijnswolfs)


    Hi there,

    I’m using the MyParcel plugin for shipping on my webshop. But I want to show the delivery date, which customers can choose during checkout, on the invoice and/or package slip. How can I achieve this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @martijnswolfs,

    If the delivery date is stored as an order metadata, you can use this code snippet to show it on your invoice:

    add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_delivery_date', 10, 2 );
    function wpo_wcpdf_delivery_date ($template_type, $order) {
    	if ( $template_type == 'invoice' && $delivery_date = $order->get_meta('delivery_date') ) {
        ?>
        <tr class="delivery-date">
            <th>Delivery Date:</th>
            <td><?php echo $delivery_date ?></td>
        </tr>
        <?php
    	}
    }

    Please note I’m using delivery_date as a generic metakey, but it can be different for the plugin you’re mentioning. See Finding WooCommerce custom fields.

    Let me know if you manage to make it work ??

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi again @martijnswolfs,

    My colleague Ewout just made me aware that the MyParcel plugin adds the {{myparcel_delivery_options}} placeholder, that you can use inside a custom block, withing the customizer, included in the Premium Extension.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘My Parcel delivery date’ is closed to new replies.