Show empty price field everywhere when 0.00

This is a discussion on Show empty price field everywhere when 0.00 within the Feature Requests forums, part of the Help & Support category; I've seen it on many big classified ads sites. When the price is 0 the field is empty. I think ...


Go Back   68 Classifieds Forums > Help & Support > Feature Requests

 
LinkBack Thread Tools Display Modes
  #1  
Old 11-13-2008, 07:51 PM
Member
 
Join Date: May 2008
Posts: 63
Rep Power: 4
Default Show empty price field everywhere when 0.00

I've seen it on many big classified ads sites. When the price is 0 the field is empty. I think it will make more sense than the present "0.00". It also can be replaced with some predefined text like "Call for the price".

Reply With Quote
  #2  
Old 11-13-2008, 09:15 PM
Moderator
 
Join Date: Mar 2006
Posts: 3,623
Rep Power: 89
Default

Quote:
Originally Posted by SecondShoe View Post
I've seen it on many big classified ads sites. When the price is 0 the field is empty. I think it will make more sense than the present "0.00". It also can be replaced with some predefined text like "Call for the price".
This is very easy to accomplish at the template level.......

replace this....
{$listingprice}

with

{$listingprice|replace:'$0.00':'Call for Price'}

or

{$listingprice|replace:'$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

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Reply With Quote
  #3  
Old 11-14-2008, 11:07 AM
Member
 
Join Date: May 2008
Posts: 63
Rep Power: 4
Default

I tried but its not working. The only file that contains {$listingprice} is userlistinginfo.tpl. When I replaced the code nothing happened.
Reply With Quote
  #4  
Old 11-14-2008, 11:23 AM
Moderator
 
Join Date: Mar 2006
Posts: 3,623
Rep Power: 89
Default

Thats was just an example and based on V3. If the viewlisting template is where you want the price altered, then look in that template for where the price is displayed.

In V4 its {$price|format_money}

you could do something like this....

{$price|format_money|replace:'$0.00':'Call for Price'}
__________________
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

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Reply With Quote
  #5  
Old 11-14-2008, 11:50 AM
Member
 
Join Date: May 2008
Posts: 63
Rep Power: 4
Default

Thanks Lhotch! You've got a big virtual beer from me .
Reply With Quote
  #6  
Old 11-16-2008, 12:02 PM
Member
 
Join Date: May 2008
Posts: 63
Rep Power: 4
Default

I just noticed a problem. When I use {$price|format_money|replace:'$0.00':'Call for Price'} a problem came up. 0.00 is fine but when the price is 3000.00 or so it turns to 300 or something like that.
Reply With Quote
  #7  
Old 11-16-2008, 12:30 PM
Moderator
 
Join Date: Mar 2006
Posts: 3,623
Rep Power: 89
Default

Quote:
Originally Posted by SecondShoe View Post
I just noticed a problem. When I use {$price|format_money|replace:'$0.00':'Call for Price'} a problem came up. 0.00 is fine but when the price is 3000.00 or so it turns to 300 or something like that.
Experiment a little bit, possibly remove the format_money and adjust the 1st element of the repalce as needed.
__________________
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

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Reply With Quote
  #8  
Old 11-29-2008, 01:50 PM
Member
 
Join Date: May 2008
Posts: 63
Rep Power: 4
Default

Big thanks to markstanden for the code! His solution works even when the currency symbol comes after the numbers.
Code:
======================
Find this code:
{if $viewprice=="Y"}
<tr>
<td><strong>{$smarty.const.LANG_PRICE}</strong></td>
<td><strong>{$price|format_money}</strong></td>
</tr>
{/if}
Replace with:
{if $viewprice=="Y"}
<tr>
<td><strong>{$smarty.const.LANG_PRICE}</strong></td>
{if $price=="0.00"}
<td><strong>{"P.O.A"}</strong></td>
{else}
<td><strong>{$price|format_money}</strong></td>
</tr>
{/if}{/if}
In showlisting.tpl
Find this code:
<td{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.price|format_money}</td>
Replace with:
<td{if $entry.class<>""} class="{$entry.class}"{/if}>{if $entry.price=="0.00"}{"P.O.A"}{else}{$entry.price|format_money}{/if}</td>
===========================
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
when price is zero don't show wesse249 v4 Questions & Support 1 09-07-2008 02:23 PM
Hide price field when price=0 canariasdata v4 Questions & Support 3 06-11-2008 03:30 PM
Price show up at featured home page need to be off cranko v4 Questions & Support 7 04-08-2008 09:10 AM
Not show price garysmith v3.1 Modules & Modifications 10 05-30-2006 06:44 AM
If Price is $0.00 Can it not show in the ad? garysmith v3.0 Questions & Support 6 04-18-2006 05:31 PM


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


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, 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 22