WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. jaybink
    Member
    Posted 10 months 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 10 months 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. Elisa Demonki
    Member
    Posted 5 months ago #

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

Reply

You must log in to post.

About this Plugin

About this Topic