WordPress.org

Forums

WooCommerce PDF Invoices & Packing Slips
[resolved] Add due date (3 posts)

  1. jaybink
    Member
    Posted 1 year ago #

    Hi, I would like to ask if it´s possible to add a "due date" (order date +14 days) to invoice?

    Thank you,
    Jay

    https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/

  2. Ewout
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Jay,
    Yes this is possible. You have to create a custom PDF invoice template (see FAQ), then insert the following code in the location where you want to insert the due date:

    <?php
    
    $order_date = $wpo_wcpdf->export->order->order_date;
    $invoice_date = get_post_meta($wpo_wcpdf->export->order->id,'_wcpdf_invoice_date',true);
    
    $due_date = date_i18n( get_option( 'date_format' ), strtotime( $order_date . ' + 14 days') );
    echo 'Due date: ' . $due_date;
    
    ?>

    If you use the invoice date, you could also change $order_date in the line before echo to $invoice date.

  3. E.
    Member
    Posted 9 months ago #

    Ewout! You are amazing :) Thank you so much!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce PDF Invoices & Packing Slips
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic