cpt.price Posted March 2, 2016 Share Posted March 2, 2016 I want to convert my 5.X theme to 6.2.X and it's find but i got problem in foreach loop so my problem is get template variable in loop how i can get $ticket.date in for each loop ? {foreach key=num item=ticket from=$tickets} <tr> ====><td>{$ticket.date}</td> <td>{$ticket.department}</td> <td><DIV ALIGN="left"><img src="images/article.gif" hspace="5" align="middle"><a href="viewticket.php?tid={$ticket.tid}&c={$ticket.c}">{if $ticket.unread}<strong>{/if}{$ticket.subject}{if $ticket.unread}</strong>{/if}</a></DIV></td> <td>{$ticket.status}</td> <td width=80>{$ticket.urgency}</td> </tr> {foreachelse} <tr> <td colspan="5">{$LANG.norecordsfound}</td> </tr> {/foreach} i read http://docs.whmcs.com/Version_6_Template_Migration_Guide but still no luck. can some one help me on this ? if i want use this template in v6.2.X how should be foreach loop ? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 2, 2016 Share Posted March 2, 2016 from the Six template, the foreach should be... {foreach from=$tickets item=ticket} 0 Quote Link to comment Share on other sites More sharing options...
zomex Posted March 2, 2016 Share Posted March 2, 2016 Hello, Depending on how you template was integrated I'd recommend replacing all files (other than header.tpl, footer.tpl and homepage.tpl where you'll need to apply changes manually) with those of the new version and then apply any customizations to these maually. Updating each file line by line would take much longer and there would be a high risk of bugs/errors with code missed. 0 Quote Link to comment Share on other sites More sharing options...
cpt.price Posted March 3, 2016 Author Share Posted March 3, 2016 thanks to both of you.that was really helpful.i forgot to ask if i want to get ticket date with $temlate it would be ($template->getVariable('myVariable')->value) what ? $template->getVariable('ticket.date')->value or $template->getVariable('ticket','date')->value or ... ? thank you in advance. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.