68 Classifieds Forums
Go Back   68 Classifieds Forums > v3.1.x Help & Support > v3.1 Questions & Support > Variables
v3.1 Questions & Support Help and support for 68 Classifieds v3.1.x

 
Thread Tools Display Modes
(#1)
Old
HotAir HotAir is offline
Junior Member
HotAir is on a distinguished road
 
Posts: 20
Join Date: Jan 2007
Default Variables - 01-06-2007, 12:46 AM

Hi,
I just purchased the dev version today and have begun editing my templates. I'm having a difficult time wioth one variable, and hope someone knows the answer:

I'm setting the value of the price using a hidden input on the page where a new ad is entered. When the list of ads in that category are displayed, degug shows the value of this variable as:

price => $2.00

I'm then testing for the value of this variable in the showlistings.tpl.php template. I've tried several ways:

{if $entry.price == "$2.00"}
{if $entry.price == $2.00}
{if $entry.price == "2.00"}
{if $entry.price == "2"}
{if $entry.price == 2}

But none of these work. I'm sure it's the way I have the above IF statement written -- what am I doing wrong?

Thanks!
Reply With Quote
(#2)
Old
Lhotch Lhotch is offline
Moderator
Lhotch has a spectacular aura about
 
Posts: 1,466
Join Date: Mar 2006
Default 01-06-2007, 09:07 AM

For some reason the dollar sign throws off smarty. You can try removing it in the comparison using replace, something like this.

{if $entry.price|replace:'$':'' == "2.00"}
Reply With Quote
(#3)
Old
HotAir HotAir is offline
Junior Member
HotAir is on a distinguished road
 
Posts: 20
Join Date: Jan 2007
Default 01-07-2007, 10:48 AM

That worked Larry, thanks!


V3.1.5b Developer
Reply With Quote
(#4)
Old
juven14 juven14 is offline
Moderator
juven14 has a spectacular aura about
 
Posts: 1,687
Join Date: Mar 2006
Location: NJ/NYC Area
Default 01-08-2007, 08:45 AM

I believe there is a slash in there and that is why the check isn't working:

/$2.00

I think there is a thread where another member found this one. Just in case you want to compare it as is.


Regards,

John
mods.auscity.com
v3.1.5 Developer

�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for list of variables. BigOrange Template Design Questions 7 10-06-2006 02:55 PM
List of Smarty Variables and Arguments? bgordon v3.1 Modifications 5 09-12-2006 03:06 PM
Smarty Variables for Featured Listings? bgordon v3.1 Questions & Support 7 09-12-2006 12:50 PM
Help with emailing global variables ichversuchte v3.1 Questions & Support 0 08-20-2006 10:30 PM
using passed variables gregbatch v3.1 Modifications 7 06-20-2006 08:37 PM



Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2007, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com