I’m using WooCommerce Invoice PDF plugin which is a plugin for an e-shop within WordPress.
The invoice plugin does not have any “due date” function so I tried to create one myself.
<?php echo $this->get_woocommerce_pdf_date ( $order_id,'ordered' ) ; ?>
Here is the string which gathers the information from the order. It collects and displays the day the order was placed. I would like to add + 20 days to that string but haven’t been able.
I have very little knowledge on PHP so I would REALLY appriciate any help at all.
You’ll want to use PHP’s
DateTime
class. You can construct the object with any date string, I used2014-01-15
in my example. Then you can::modify()
it and get the string by using::format()
. Check the documentation for other formats, but I usedY-m-d
.If you get your date’s string with the
get_woocommerce_pdf_date()
function, you can integrate this like so: