Support Forums

Hide price field when price=0

This is a discussion on Hide price field when price=0 within the Technical Support forums, part of the Technical Support Forums category; Hello and sorry, me again Another little problem I couldn't solve on my own searching the forum. How can I ...


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-10-2008, 04:14 PM   #1
Customer
 
Join Date: May 2008
Location: Lanzarote/spain
Posts: 71
Rep Power: 15
canariasdata is on a distinguished road
Default Hide price field when price=0

Hello and sorry, me again

Another little problem I couldn't solve on my own searching the forum.

How can I hide the price field when price=0?

I would need to do this in first place for showlistings.tpl as I have "Custom Categories Module" installed but -as yous know- this only effects the categorie and searchresult view of listings.

Any Idea?

Cheers & thanks,
Gregor.
__________________
4.0.3 Developer
canariasdata is offline  
Old 06-11-2008, 12:10 AM   #2
Senior Member
 
Join Date: Jul 2007
Posts: 109
Rep Power: 19
Greg H is on a distinguished road
Default

This is what I did in V3 to replace any price of 0 with "P.O.A"

In showlisitings.tpl.php, find this code:

PHP Code:
{if $sDisPrice == "Y"}
          <
td{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.price}</td
I replaced it with this.

PHP Code:
{if $sDisPrice == "Y"}

          <
td{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.price|replace:'$0.00':'P.O.A'}</td
Then, any listing with a price of 0, shows P.O.A as the price.

You may be able to achieve what you want by playing with that code.
Im not sure if you could use this:

PHP Code:
{if $sDisPrice == "Y"}

          <
td{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.price|replace:'$0.00':''}</td
Which is the same as above without the P.O.A

Good Luck
__________________
Greg

Version 3.1.9 and 4.0.3 Developer
Greg H is offline  
Old 06-11-2008, 03:25 AM   #3
Customer
 
Join Date: May 2008
Location: Lanzarote/spain
Posts: 71
Rep Power: 15
canariasdata is on a distinguished road
Default

Hi Greg,
thanks for your reply.

UPS, my error, I want to remove the price from viewlisting.tpl and not only the price value but the "Price" as well.

Something like:
HTML Code:
{if $viewprice=="Y"  && $price != 0}
<tr> 
 <td><h3>{$smarty.const.LANG_PRICE}:</h3></td>
<td><h3>{$price|format_money}</h3></td>
</tr>
{else}
<tr> 
 <td> </td>
<td> </td>
</tr>
{/if}
Any Ideas?
__________________
4.0.3 Developer
canariasdata is offline  
Old 06-11-2008, 02:30 PM   #4
Customer
 
Join Date: May 2008
Location: Lanzarote/spain
Posts: 71
Rep Power: 15
canariasdata is on a distinguished road
Default

Ok, with my above question I nearly gave myself the answer.

I tried a few times it and it finaly works like this:

HTML Code:
{if $viewprice=="Y" && $price <> "0"}
<tr> 
<td><h3>{$smarty.const.LANG_PRICE}:</h3></td>
<td><h3>{$price|format_money}</h3></td>
</tr>
{/if}
Maybe helpfull for someone in the future...
__________________
4.0.3 Developer
canariasdata is offline  

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