Support Forums

Php help removing price please

This is a discussion on Php help removing price please within the Technical Support forums, part of the Technical Support Forums category; Hi all.... i've been going through my v4 removing the price field if it's set to �0.00 in my showlistings ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 06-07-2007, 06:56 AM   #1
Senior Member
 
Join Date: Sep 2006
Posts: 236
Rep Power: 20
Tim_A is on a distinguished road
Question Php help removing price please

Hi all....

i've been going through my v4 removing the price field if it's set to �0.00 in my showlistings and viewlistings templates using this code:

{$entry.price|format_money|replace:'�0.00':''}

which is working great!

I now need to do it to the featured listings on the homepage, but can't work out how to do it.

My 2 options are:

home.tpl.php

or

includes/classes/smarty/plugins/function.feature_listings_horizontal.php

I'm guessing this is the code to edit on the latter:

if($show_price=='Y')
{
$output.= $loop[$x][price];
}

but my lack of php knowledge is letting me down.

Any suggestions/help always welcome
__________________
V4.0.9 Developer
Tim_A is offline  
Old 06-07-2007, 09:37 AM   #2
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,467
Rep Power: 130
Eric Barnes is just really nice Eric Barnes is just really nice
Default

In your home template file you should be able to add show_price="N" to the function call.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline  
Old 06-07-2007, 09:49 AM   #3
Senior Member
 
Join Date: Sep 2006
Posts: 236
Rep Power: 20
Tim_A is on a distinguished road
Default

Thanks for repling Eric, hope the arm's on the mend...

but what I mean is that I don't want it to show the price when it is zero (�0.00), but show it when it's a value (i.e. $3,500).

I've added the code in my previous post to the showlistings tpl which removes the price when it's �0.00 (i.e. for business listings) but I need to do the same on the featured ads on the homepage.
__________________
V4.0.9 Developer
Tim_A is offline  
Old 06-07-2007, 02:36 PM   #4
Staff
 
Join Date: Mar 2006
Posts: 454
Rep Power: 27
Blair will become famous soon enough
Default

I think if you open your includes/classes/smarty/function.feature_listings_horizontal.php and change:
PHP Code:
$output.=$loop[$x][title] ."<br />";
if(
$show_price=='Y')
   {
      
$output.= $loop[$x][price];
   } 
to
PHP Code:
$output.=$loop[$x][title] ."<br />";
if(
$show_price=='Y' && $loop[$x][price]!='0')
   {
      
$output.= $loop[$x][price];
   } 
__________________
Blair
68C Staff

68C Downloads | Report a Bug | Knowledge Base
Blair is offline  
Old 06-07-2007, 07:14 PM   #5
Senior Member
 
Join Date: Sep 2006
Posts: 236
Rep Power: 20
Tim_A is on a distinguished road
Default

Thanks for replying Blair....

unforunately that code didn't seem to work.. it still displayed it as �0.00 ???
__________________
V4.0.9 Developer
Tim_A is offline  
Old 06-08-2007, 08:55 AM   #6
Moderator
 
juven14's Avatar
 
Join Date: Mar 2006
Location: Texas
Posts: 1,998
Rep Power: 60
juven14 is a jewel in the rough
Default

PHP Code:
$output.=$loop[$x][title] ."<br />";
if(
$show_price=='Y' && $loop[$x][price]!='0' && $loop[$x][price]!='�0.00')
{
  
$output.= $loop[$x][price];

__________________
John Snyder
PHP Developer
juven14 is offline  
Old 06-08-2007, 08:59 AM   #7
Senior Member
 
Join Date: Sep 2006
Posts: 236
Rep Power: 20
Tim_A is on a distinguished road
Default

You're a star Perfect!
__________________
V4.0.9 Developer
Tim_A is offline  
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing the Price Field sporthorsebreeder Templates, HTML, CSS, and Design Help 14 07-20-2007 09:47 PM


All times are GMT -4. The time now is 06:43 PM.


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