Support Forums

Show NA istead of 0 in price field

This is a discussion on Show NA istead of 0 in price field within the Technical Support forums, part of the Technical Support Forums category; Hi, When no price if filled in the price field I want NA to appear instead of 0. I read ...


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 04-29-2009, 07:03 AM   #1
Member
 
Join Date: Nov 2008
Posts: 82
Rep Power: 10
Isje is on a distinguished road
Default Show NA istead of 0 in price field

Hi,

When no price if filled in the price field I want NA to appear instead of 0. I read some threads here and I managed to do this only in the viewlisting.tpl and showlistings.tpl. But on the category page the 0 still appears.

Where can I change this?

Thanks
__________________
Using v4.1.5 Developer
NuStyle Template

Last edited by Isje; 04-29-2009 at 07:57 AM.
Isje is offline  
Old 04-29-2009, 07:58 AM   #2
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 1,074
Rep Power: 32
bowers01 is on a distinguished road
Default

{$price|format_money|replace:'$0':'NA'}
Replace the $0 with what your sites shows, ie $0.00 or other currency

Nick
__________________
Nick Bowers
68c v4.1.10 Developer Custom Template
bowers01 is offline  
Old 04-29-2009, 08:12 AM   #3
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,955
Rep Power: 73
seymourjames is a jewel in the rough
Default

If you have used the replacement code in your showlistings and viewlistings pages then you have done it. Are you misunderstanding that the (0) on a category page (browse) is in fact saying there are no listings in this category. If this is infact the case, you can turn off showing the number of items in a category from your admin control panel.

Also, please put your 68C version (designer or develper) + your template into your forum signature. Help us to help you.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds
seymourjames is offline  
Old 04-29-2009, 08:14 AM   #4
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 1,074
Rep Power: 32
bowers01 is on a distinguished road
Default

Sorry i missed "But on the category page the 0 still appears" or did you add this while i was posting?

Anyway that is a totally different thing.

Nick
__________________
Nick Bowers
68c v4.1.10 Developer Custom Template
bowers01 is offline  
Old 04-29-2009, 09:29 AM   #5
Member
 
Join Date: Nov 2008
Posts: 82
Rep Power: 10
Isje is on a distinguished road
Default

I changed the price field format in both tpl files, but the category page (category.php?cat=xxx) still shows 0 in the price field.

Thanks again
__________________
Using v4.1.5 Developer
NuStyle Template
Isje is offline  
Old 04-29-2009, 09:58 AM   #6
curmudgeon
 
Join Date: Mar 2006
Posts: 5,343
Rep Power: 132
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Quote:
Originally Posted by Isje
I changed the price field format in both tpl files, but the category page (category.php?cat=xxx) still shows 0 in the price field.

Thanks again
You also need to edit /templates/<templatename>/categories/browse.tp
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 04-29-2009, 10:07 AM   #7
Member
 
Join Date: Nov 2008
Posts: 82
Rep Power: 10
Isje is on a distinguished road
Default

Quote:
Originally Posted by Lhotch
You also need to edit /templates/<templatename>/categories/browse.tp
Hi Lhotch,

I checked the browse.tpl but I don't see any format for the price field there

Thanks again
__________________
Using v4.1.5 Developer
NuStyle Template
Isje is offline  
Old 04-29-2009, 10:42 AM   #8
curmudgeon
 
Join Date: Mar 2006
Posts: 5,343
Rep Power: 132
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

My mistake, too many things going on at the same time.

You said you edited both template files, viewlistings and showlistings.

There are actually 2 different showlistings templates so you need to make sure you edit the one you are using. There is showlistings.tpl and showlistings2.tpl.

Also when done editing the files, delete all the files but index.html from the folder /templates_c.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 04-29-2009, 06:15 PM   #9
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,955
Rep Power: 73
seymourjames is a jewel in the rough
Default

I think you are getting confused. If you have edited your showlistings.tpl file (or showlistings2.tpl file) and your viewlistings.tpl, you should not be seeing $0.00 . Do clear your templates_c directory of everything but the index file.

Do read my original post.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds
seymourjames is offline  
Old 04-30-2009, 06:53 AM   #10
Member
 
Join Date: Nov 2008
Posts: 82
Rep Power: 10
Isje is on a distinguished road
Default

Quote:
Originally Posted by seymourjames
I think you are getting confused. If you have edited your showlistings.tpl file (or showlistings2.tpl file) and your viewlistings.tpl, you should not be seeing $0.00 . Do clear your templates_c directory of everything but the index file.

Do read my original post.
Hi, I was confused indeed.

I was using this code for both templates:
{if $price == '0.00'} N/A {else} {$price|format_money}{/if}

In the showlistings.tpl I should have used this: {if $entry.price == '0.00'} N/A {else} {$entry.price|format_money}{/if}. So that's what was causing the problem.


Now, how can I eliminate the 0.00 showing in the usermodifylisting page when no value has been entered?

Many thanks again
__________________
Using v4.1.5 Developer
NuStyle Template
Isje is offline  
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
when price is zero don't show wesse249 Technical Support 1 09-07-2008 02:23 PM
Hide price field when price=0 canariasdata Technical Support 3 06-11-2008 03:30 PM


All times are GMT -4. The time now is 10:19 PM.


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