Printable order copy - adding a "Due date" field

Hey,

lately I've been struggling with trying to add a "Due date" field to our printable order copies (as they act out as our invoices in the end, thanks to some changes on our end).

The due date needs to be several days after the order date, which I just can't find out how to edit in order to make it work.

Original code:


 strtotime($order['date_created'])) : date(language::$selected['raw_date']); ?>```

This returns the date of the order. After going through [url=https://stackoverflow.com/questions/5174789/php-add-7-days-to-date-format-mm-dd-yyyy]this StackOverflow entry[/url], I tried adding "strtotime('+7 days')" several different ways to the original code, but always ending messing it up and returning errors or a completely different date. 

I am not that advanced with PHP, so I thought maybe I could get some help here as to how to add any amount of days to the date of when the order was created (it will be either 7 or 14 or 31 days in our configuration)

LiteCart version 2.2.1

Thanks for any feedback!
tim

Try this:
<?php echo date(language::$selected['raw_date'], strtotime('+7 days', strtotime($order['date_created']))); ?>

Or do "+7 weekdays" to skip sat and sun.

Awesome Tim, thanks a lot, it works :)

Den här tråden har stängts på grund av lång inaktivitet. Det går inte att posta inlägg till den.
Se kod på GitHub