• Resolved madhushanr

    (@madhushanr)


    Hi,

    I am using the Order Delivery Date for WooCommerce (Tyche Softwares) plugin for customers to select their delivery date.

    By default, deliver date showing just below the order totals in the Invoice. But, I want to show this below the regular order data on the Invoice. I tried adding a custom field option and manage to get the Field Name but not the Field value (date). Is it possible to do this?

    Thanks in advance!

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

    (@yordansoares)

    Hello @madhushanr,

    Tyche stores it as a UNIX timestamp. This means it will need to be converted to a human readable format first. Our Premium Templates does this automatically.

    Hi @madhushanr,

    This is Chetna from Tyche Softwares. I would like to let you know that we do store a human readable date format too in the database. You can fetch the delivery date using the ‘Delivery Date’ field label set in the plugin’s setting.

    For eg,
    $delivery_date = get_post_meta( $order_id. ‘Delivery Date’, true); // you will get human readable delivery date

    Thanks,
    Chetna Bhutka

    Thread Starter madhushanr

    (@madhushanr)

    Hi @chetnapatel

    Thanks for your detailed reply. I tried editing the

    Delivery date field is set as “Delivery/Pickup Date” in the plugin settings and I’m trying to get the Delivery date just below the Payment Method. And this is how template code is capturing the Payment Method. Can I use something similar to capture the Delivery date also?

    <tr class=”payment-method”>
    <th><h3><?php _e( ‘Payment Method:’, ‘woocommerce-pdf-invoices-packing-slips’ ); ?></h3></th>
    <td><?php $this->payment_method(); ?></td>
    </tr>

    Thanks in advance!

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hello @madhushanr,

    Try using this code snippet:

    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') {				
            ?>
            <tr class="delivery-date">
                <th>Delivery Date:</th>
                <td><?php echo $order->get_meta('Delivery Date');; ?></td>
            </tr>
            <?php
        }
    }

    Hope it helps!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Delivery date on Invoice’ is closed to new replies.