ubuntuchosen Developer Från Czech Republic Medlem sedan dec. 2018 ubuntuchosen 29 juni 2020 23:55 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 Founder Från Sweden Medlem sedan maj 2013 tim 2 juli 2020 22:49 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.
ubuntuchosen Developer Från Czech Republic Medlem sedan dec. 2018 ubuntuchosen 5 juli 2020 19:50 Awesome Tim, thanks a lot, it works :)