• Resolved matthorrocks18

    (@matthorrocks18)


    Please can you help me display the purchase TIME next to the purchase date? Or possible on a new line also (both options would be great). I already have the following code to display purchase DATE, which is great, but i need to have the TIME the product was purchased also on the PDF.

    <tr class=”order-number”>
    <th><?php _e( ‘Purchase Date:’, ‘wpo_wcpdf’ ); ?></th>
    <td><?php $wpo_wcpdf->order_date(); ?></td>
    </tr>

    Thank you
    Matt

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

    (@pomegranate)

    Hi Matt,
    You can show the order date with the following code:

    
    <?php echo $this->order->get_date_created()->date_i18n(wc_time_format()); ?>
    

    If you have a license for the Premium Templates extension, you can do this via the customizer, by adding a custom block with the placeholder {{order_time}}:

    You can use several placeholders like that in custom blocks, more information can be found in the documentation: Using custom blocks

    Note that the $wpo_wcpdf global and the wpo_wcpdf textdomain i your example are deprecated since version 2.0 (june 2017), I recommend updating your templates!

    Thread Starter matthorrocks18

    (@matthorrocks18)

    That worked great! Thank you.

    I have got the pro version, but i am adding the custom code to the content of the pdf documents. It is working well and how i want it now.

    Thanks for the quick response.

    Matt

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to display purchase time next to / or below date?’ is closed to new replies.