Support Forums

Removing the Price Field

This is a discussion on Removing the Price Field within the Templates, HTML, CSS, and Design Help forums, part of the General category; Is it possible to remove or rename the Price Field for certain categories? Thanks for any help Cheers Hugh...


Go Back   68 Classifieds Forums > General > Templates, HTML, CSS, and Design Help

Reply
 
Thread Tools Display Modes
Old 04-11-2006, 07:00 AM   #1
Senior Member
 
Join Date: Apr 2006
Posts: 103
Rep Power: 25
sporthorsebreeder will become famous soon enough
Default Removing the Price Field

Is it possible to remove or rename the Price Field for certain categories?
Thanks for any help
Cheers
Hugh
sporthorsebreeder is offline   Reply With Quote
Old 04-11-2006, 09:10 AM   #2
Staff
 
Join Date: Mar 2006
Location: New Jersey
Posts: 2,149
Rep Power: 68
John Snyder is a jewel in the rough
Default

Yes.

You will need to change category.php just be for the last line to look like this:

PHP Code:
$class_tpl->assign('sec',$sec);
$class_tpl->assign('body',$body);
        
$class_tpl->display('layout.tpl.php'); 
Then in showlistings.tpl.php:

find the field you wish to rename (In this case I renamed the field to Ranch for only one category (24) and gave it a specific width.)

HTML Code:
{if $sDisTitle == "Y"}
    <th {if $sec==24}width="100"{/if}>{if $sec==24}Ranch Name{else}{$smarty.const.LANG_TITLE}{/if}</th>
{/if}
To change the name in the actual ad open viewlisting.tpl.php and find the field you wish to change.

HTML Code:
    {if $viewprice=="Y"}
    <tr> 
        <td><strong>{if $listingsection == "1"}Some other name {else}{$smarty.const.LANG_PRICE}{/if{:</strong></td>
        <td>{$listingprice}</td>
    </tr>
    {/if}
Here is a post where I detailed how to hide it based on the category:

http://www.68classifieds.com/forums/...06&postcount=4
__________________
John
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket

Last edited by John Snyder; 04-11-2006 at 09:17 AM.
John Snyder is offline   Reply With Quote
Old 04-11-2006, 09:11 AM   #3
curmudgeon
 
Join Date: Mar 2006
Posts: 5,413
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

removing the price field can be done but carries with it some issues. In order to remove the price from only certain categories a check needs to be put in place in 3 difeerent templates to check the current category and if thats the category your in it wont show the price. The problem with this is if someone does a search they wont be in a category and will possibly get a mix of ads with and without prices

What a few have done is just insert a check to see if the price field contains a zeros or is empty and if so it just puts a few dashes in the price field. Its a little cleaner solution, would that work for you?
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 04-11-2006, 09:20 AM   #4
Staff
 
Join Date: Mar 2006
Location: New Jersey
Posts: 2,149
Rep Power: 68
John Snyder is a jewel in the rough
Default

Here is the code to detect a 0.00 value and replace it with ------ or whatever text you wish to be displayed:

{$entry.price|replace:'$0.00':'----------'} here '$0.00' is the value you wish to replace and '---------' is what you wish to replace it with.

You have to open viewlisting.tpl.php and showlistings.tpl.php and find {$entry.price} and replace it with {$entry.price|replace:'$0.00':'----------'}
__________________
John
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
John Snyder is offline   Reply With Quote
Old 04-11-2006, 12:09 PM   #5
Senior Member
 
Join Date: Apr 2006
Posts: 103
Rep Power: 25
sporthorsebreeder will become famous soon enough
Default

Hello John
I found the code {$entry.price} and replaced it with {$entry.price|replace:'$0.00':'----------'} in the showlistings.tpl.php file. It was found on line 83. I searched for {$entry.price} in viewlistings.tpl.php but it was not found.
When I looked at the ads on the site it has made no difference.
Any idea what I am doing wrong?
Cheers
Hugh
sporthorsebreeder is offline   Reply With Quote
Old 04-11-2006, 12:16 PM   #6
Staff
 
Join Date: Mar 2006
Location: New Jersey
Posts: 2,149
Rep Power: 68
John Snyder is a jewel in the rough
Default

Sorry, it has a different name in viewlistings.tpl.php:

find:
HTML Code:
{if $viewprice=="Y"}
<tr> 
  <td><strong>{$smarty.const.LANG_PRICE}:</strong></td>
  <td>{$listingprice}</td>
</tr>
{/if}
replace with:
HTML Code:
{if $viewprice=="Y"}
<tr> 
  <td><strong>{$smarty.const.LANG_PRICE}:</strong></td>
  <td>{$listingprice|replace:'$0.00':'----------'}</td>
</tr>
{/if}
__________________
John
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
John Snyder is offline   Reply With Quote
Old 04-11-2006, 12:39 PM   #7
Senior Member
 
Join Date: Apr 2006
Posts: 103
Rep Power: 25
sporthorsebreeder will become famous soon enough
Default

Hello John
Found it now and replaced it.
Still no joy I'm afraid
Any ideas
Cheers
Hugh
sporthorsebreeder is offline   Reply With Quote
Old 04-11-2006, 12:45 PM   #8
Staff
 
Join Date: Mar 2006
Location: New Jersey
Posts: 2,149
Rep Power: 68
John Snyder is a jewel in the rough
Default

you have a link so I can be sure we are on the same page?
__________________
John
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
John Snyder is offline   Reply With Quote
Old 04-11-2006, 01:01 PM   #9
Senior Member
 
Join Date: Apr 2006
Posts: 103
Rep Power: 25
sporthorsebreeder will become famous soon enough
Default

Hello John
Here is a link to the listing page.
http://www.thoroughbreddiaries.com/v...ing.php?view=8
If you like I can e-mail you the showlistings.tpl.php and viewlistings.tpl.php files for you to have a look.
Thanks for your time.
Cheers
Hugh
sporthorsebreeder is offline   Reply With Quote
Old 04-11-2006, 01:03 PM   #10
Staff
 
Join Date: Mar 2006
Location: New Jersey
Posts: 2,149
Rep Power: 68
John Snyder is a jewel in the rough
Default

have you switched out the $ in that bit of code with the �
__________________
John
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
John Snyder is offline   Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 04:36 AM.


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