Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

{if} you cant !! you must ask help

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
lekker
Smarty n00b


Joined: 26 Apr 2014
Posts: 1

PostPosted: Sat Apr 26, 2014 8:11 pm    Post subject: {if} you cant !! you must ask help Reply with quote

Hello Guys,

Im new here and i need help for my smarty template. Im busy with course details page and i want here if price null is only description ( no other datas )

i'll separate codes to easy understanding...

Course price code : {$T_COURSE->course.price_string}



<div class="coursedetails">
<h1>{$smarty.const._COURSE} {$smarty.const._DETAILS} : <span>{$T_COURSE->course.name}</span></h1>

{foreach name = 'info_list' item = "item" key = "key" from = $T_COURSE_INFO->metadataArray}
<p>{$item|replace:"\n":"<br />"}</p>
{/foreach}

<ul>

***********IF PRICE NULL do not show between *****************

<li><span class="gray">{$smarty.const._COURSEDETAILS_COURSEIN} : </span><span>{$T_COURSE->course.city_name}</span></li>
<li><span class="gray">{$smarty.const._START} : </span><span>#filter:timestamp-{$T_COURSE->course.start_date}#</span></li>
<li><span class="gray">{$smarty.const._TIME} : </span>{if $T_COURSE->course.lesson_start_time}<span>#filter:timestamp_time_only_nosec-{$T_COURSE->course.lesson_start_time}# to #filter:timestamp_time_only_nosec-{$T_COURSE->course.lesson_end_time}#</span>{/if}</li>
<li>
{php}
$Course = $this->get_template_vars("T_COURSE");
echo str_replace(array('%s1', '%s2'), array($Course->course['max_users'], $Course->course['seats_remaining']), _COURSEDETAILS_TOTAL);
{/php}</li>
<li><span class="gray">{$smarty.const._PRICE} : </span><span>{$T_COURSE->course.price_string}</span></li>
</ul>

{$smarty.capture.t_buy_course_code}
<div class="clear"></div>
</div>
***************if price null dont show to here ******************
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Mon Apr 28, 2014 7:23 pm    Post subject: Reply with quote

Code:
{if $T_COURSE->course.price_string != 0}
...
{/if}


Perhaps you have to replace the 0 by the price_string value of a null price.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General 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