Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
add 6 month to a date in prestashop invoice

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
Toniomoricone
Smarty n00b


Joined: 26 Aug 2013
Posts: 2

PostPosted: Mon Aug 26, 2013 9:18 am    Post subject: add 6 month to a date in prestashop invoice Reply with quote

Hello,
i try to add 6 month to this date in the invoice.tpl :
{$order->date_add|date_format:"%d-%m-%Y"}

I have tried this :
{assign var=date_val value=$order->date_add+"6 month"}
{$date_val|date_format:"%d-%m-%Y"}

but it doesn't work.
Thanks for your help.
Back to top
View user's profile Send private message
Toniomoricone
Smarty n00b


Joined: 26 Aug 2013
Posts: 2

PostPosted: Mon Aug 26, 2013 11:59 am    Post subject: Reply with quote

The solution :

Code:

{capture assign="unix"}{$order->date_add}{/capture}
{math equation="x + y" x=$unix|strtotime y=15897600 assign="6mois_date"}
                     {$6mois_date|date_format:"%d-%m-%Y"}
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4596
Location: Hamburg / Germany

PostPosted: Mon Aug 26, 2013 3:29 pm    Post subject: Reply with quote

The following code should do the job

Code:
{strtotime("+6 month",$order->date_add)|date_format:"%d-%m-%Y"}
Back to top
View user's profile Send private message
MemphisChild
Smarty n00b


Joined: 14 Sep 2013
Posts: 1
Location: usa

PostPosted: Sat Sep 14, 2013 7:30 am    Post subject: Reply with quote

The following code may be help you dude Smile

{capture assign="unix"}{$order->date_add}{/capture}
{math equation="x + y" x=$unix|strtotime y=15897600 assign="6mois_date"}

http://www.fetchflow.com/support/question/How-do-I-schedule-recurring-invoices.html
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP