What's wrong in my code for price=0 to disappear in feature_listings_horizontal?

This is a discussion on What's wrong in my code for price=0 to disappear in feature_listings_horizontal? within the v3.1 Questions & Support forums, part of the v3.1 Legacy Help & Support category; Hello, in function.feature_listings_horizontal.php: //$output .= "<td" . smarty_function_html_table_cycle_68('td', $td_attr, $c) . ">"; //text $output.=$loop[$x][title] ."<br />"; if($show_price=='Y') { $output.= $loop[$x][price]; ...


Go Back   68 Classifieds Forums > v3.1 Legacy Help & Support > v3.1 Questions & Support

 
LinkBack Thread Tools Display Modes
  #1  
Old 12-07-2008, 10:58 AM
Junior Member
 
Join Date: Aug 2006
Posts: 5
Rep Power: 0
Default What's wrong in my code for price=0 to disappear in feature_listings_horizontal?

Hello,

in function.feature_listings_horizontal.php:

Quote:
//$output .= "<td" . smarty_function_html_table_cycle_68('td', $td_attr, $c) . ">";

//text
$output.=$loop[$x][title] ."<br />";
if($show_price=='Y')
{
$output.= $loop[$x][price];
}
//close td
$output.="</td>\n";
I have tried to change if($show_price=='Y') to if($show_price=='Y' AND price<>0) but all prices disappear and it's logic

but what is the syntax to say that price is DIFFERENT OF 0?

I have tried with price<1 but this trick doesn't work

Thanks in advance,


gramlou


v3.1.10

Reply With Quote
  #2  
Old 12-07-2008, 11:30 AM
Moderator
 
Join Date: Mar 2006
Posts: 3,772
Rep Power: 92
Default

For starters, the zero should be in quotes. Next you need to make sure zero is what is actually displayed when a price is zero. 0 is not the same as 0.00 which is not the sames as $0.00.
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

Set your site apart from the competition with one of my modules......
Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Reply With Quote
  #3  
Old 12-07-2008, 11:35 AM
Moderator
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,059
Rep Power: 33
Default

I haven't tried or tested this, but I don't see why it wouldn't work. Try this instead:
Code:
$output.=$loop[$x][title] ."<br />";
if($show_price=='Y')
{
   if(price=='0.00')
   {
   $output.=" ";
   }
   else
   {
      $output.= $loop[$x][price];
   }
}
//close td
$output.="</td>\n";
You might need to play around with the If(price=='0.00') statement.

-Mike
__________________
Mike-N-Tosh
v3.1.10 Developer IndianaPC.org - A community website
Sandbox v4.0.9, 4.1RC2
Templates, Mods & Docs for sale | My blog with much content for 68 Classifieds.
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Reply With Quote
  #4  
Old 12-08-2008, 06:46 AM
Junior Member
 
Join Date: Aug 2006
Posts: 5
Rep Power: 0
Default

Thanks Larry for this quick answer.
I didn't thought i have to carry about 0 is not the same as 0.00 which is not the sames as $0.00. Now i get care of it

Thanks Mike for this quick proposal.
I have pasted the code and the feature disappear. Perhaps I have pasted at the wrong location. I will retry but i have an idea of what to do now.

Gramlou
Reply With Quote

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
What the {if} am I doing wrong? BigOrange v3.1 Modules & Modifications 13 08-19-2008 07:02 PM
text disappear when typed VotreEspace v4 Questions & Support 3 07-07-2008 05:50 PM
My 68c modification story..Tell me if I'm wrong GPM55 Off Topic 16 04-18-2008 12:03 AM
Wrong Version Pierce v3.1 Questions & Support 3 09-18-2007 03:06 AM
Wrong PREFIX in usershare MVBaker v3.1 Questions & Support 4 11-03-2006 12:41 AM


All times are GMT -4. The time now is 09:55 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21