View previous topic :: View next topic |
Author |
Message |
FrankinHolland Smarty Rookie
Joined: 19 Jul 2011 Posts: 14
|
Posted: Tue Mar 20, 2012 11:17 pm Post subject: Number Formatting in .tpl files |
|
|
Hi all,
Is there any way to format number output in .tpl files? I tried the few examples on the site with no success. The output I want to modify is here:
<td height="17" class="redmatter">Price: {if $FeaturedProduct[i].dPrice neq ""}{$FeaturedProduct[i].dPrice}{/if}</td>
I want to format the $FeaturedProduct[i].dPrice like $1,000 for example
Thanks very much. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
|
Back to top |
|
FrankinHolland Smarty Rookie
Joined: 19 Jul 2011 Posts: 14
|
Posted: Wed Mar 21, 2012 6:08 pm Post subject: Thanks again! |
|
|
I can't tell you how much I have appreciated your help. |
|
Back to top |
|
FrankinHolland Smarty Rookie
Joined: 19 Jul 2011 Posts: 14
|
Posted: Wed Mar 21, 2012 6:22 pm Post subject: Is there a plugin required? |
|
|
Sorry if this is a newbie question but I am getting the following error:
Fatal error: require_once() [function.require]: Failed opening required 'SMARTY_CORE_DIRcore.load_plugins.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xxxx/public_html/xxxx.xxx/templates_c/%%609^%%609278444^home.tpl.php on line 3 |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Mar 21, 2012 6:50 pm Post subject: |
|
|
Delete all files in the ....../template_c/ folder and retry.
Looks like that the constant SMARTY_CORE_DIR was not defined correctly when the temlates got compiled. |
|
Back to top |
|
FrankinHolland Smarty Rookie
Joined: 19 Jul 2011 Posts: 14
|
Posted: Wed Mar 21, 2012 7:33 pm Post subject: SMARTY_CORE_DIR? |
|
|
Still getting the same error. This is what is triggering it:
{$FeaturedProduct[i].dPrice|string_format:"%.2f"}
I will look up info on SMARTY_CORE_DIR and double check my settings. Thanks again for your input. |
|
Back to top |
|
FrankinHolland Smarty Rookie
Joined: 19 Jul 2011 Posts: 14
|
Posted: Mon Mar 26, 2012 10:49 pm Post subject: CORE path issues |
|
|
Something is wrong with my CORE files. Working on it.... Thanks for pointing me in the right direction. |
|
Back to top |
|
FrankinHolland Smarty Rookie
Joined: 19 Jul 2011 Posts: 14
|
Posted: Tue Mar 27, 2012 5:18 pm Post subject: Resolved |
|
|
I deleted all my Smarty files and reloaded 2.6.26 and that seems to have resolved the problem. I had mixed files and the core vs. internals\core seems to have been the problem. I want to upgrade to 3.1.8 but I don't feel like I have complete control over the site yet so I will be doing this slowly. Thanks again for your help. |
|
Back to top |
|
|