Price Descriptor Mod - SOLD

This is a discussion on Price Descriptor Mod - SOLD within the v3.1 Modules & Modifications forums, part of the v3.1 Legacy Help & Support category; {if $entry.prePrice == "SOLD"} <font class="sold">SOLD</font> {else} {$entry.prePrice} {/if}</td> This only displays the sold class id SOLD is entered in ...


Go Back   68 Classifieds Forums > v3.1 Legacy Help & Support > v3.1 Modules & Modifications

 
LinkBack Thread Tools Display Modes
  #1  
Old 03-29-2007, 09:07 PM
midi510's Avatar
Senior Member
 
Join Date: Mar 2007
Location: Mammoth Lakes, Ca
Posts: 135
Rep Power: 11
Default Price Descriptor Mod - SOLD

Quote:
{if $entry.prePrice == "SOLD"}
<font class="sold">SOLD</font>
{else}
{$entry.prePrice}
{/if}</td>
This only displays the sold class id SOLD is entered in all caps. Can I add "Sold" & "sold" to the if statement and what do I use for a separator?

__________________
Kirk
V3.1.7 Developer
May you & your loved ones be blessed with
Grace, Peace, Forgiveness, Love, Wisdom, & Joy
Reply With Quote
  #2  
Old 03-29-2007, 10:23 PM
Chaslie's Avatar
Moderator
 
Join Date: Mar 2006
Location: Great Ocean Road - Australia
Posts: 698
Rep Power: 25
Default

KS,
Have moved this post to 'Modules 3.1' because it is a module question.

Try this and let us know how you got on.

{if $entry.prePrice == "SOLD" || $entry.prePrice == "Sold" || $entry.prePrice == "sold"}
<font class="sold">SOLD</font>
{else}
{$entry.prePrice}
{/if}</td>
__________________
Chaslie
V3.1.10 dev
AUSCITY

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals

HTML Help
W3 Schools
Reply With Quote
  #3  
Old 03-30-2007, 01:06 AM
midi510's Avatar
Senior Member
 
Join Date: Mar 2007
Location: Mammoth Lakes, Ca
Posts: 135
Rep Power: 11
Default

Hi Chaslie,

I tried to post this in the modules sub-forum, but got a message saying I wasn't allowed.

Anyway, that didn't work, but this did. I included the whole block 'cause the listingprice|replace finishes this mod out perfectly for me. Just what I was looking for.

Code:
{if $viewprice=="Y"}
  <tr> 
  <td><strong>{$smarty.const.LANG_PRICE}:</strong></td>
  <td>
  {if $prePrice == "SOLD" || "Sold" || "sold"}
   <font class="sold">SOLD!</font>
  {else}
   {$prePrice}
  {/if} 
  {$listingprice|replace:'$0.00':'<font class="sold">SOLD!</font>'} 
  {if $postPrice == "SOLD" ||  "Sold" || "sold"}
   <font class="sold">SOLD!</font>
  {else}
   {$postPrice}
  {/if}</td>
Take a look. http://www.mammothgoods.com/viewlisting.php?view=9
__________________
Kirk
V3.1.7 Developer
May you & your loved ones be blessed with
Grace, Peace, Forgiveness, Love, Wisdom, & Joy

Last edited by midi510; 03-30-2007 at 01:13 AM. Reason: Add example link
Reply With Quote
  #4  
Old 03-30-2007, 01:13 AM
Chaslie's Avatar
Moderator
 
Join Date: Mar 2006
Location: Great Ocean Road - Australia
Posts: 698
Rep Power: 25
Default

Good work and well done, KS. I'll be adding that to my own Price Descriptor mod. Thanks.
__________________
Chaslie
V3.1.10 dev
AUSCITY

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals

HTML Help
W3 Schools
Reply With Quote
  #5  
Old 03-30-2007, 01:30 AM
midi510's Avatar
Senior Member
 
Join Date: Mar 2007
Location: Mammoth Lakes, Ca
Posts: 135
Rep Power: 11
Default

One more thing, I enclosed it in nobr tags to make sure smaller browser windows don't break it up. I don't know what the concensus is on nobr, but it works.
__________________
Kirk
V3.1.7 Developer
May you & your loved ones be blessed with
Grace, Peace, Forgiveness, Love, Wisdom, & Joy
Reply With Quote
  #6  
Old 03-30-2007, 01:37 AM
Chaslie's Avatar
Moderator
 
Join Date: Mar 2006
Location: Great Ocean Road - Australia
Posts: 698
Rep Power: 25
Default

BTW, did you add this code to 'showlistings.tpl.php? I found a problem - check your listings and they are all being displayed as sold. I'll look into it in 30 mins - tied up at present.

Although in viewlistings.tpl.php, it is {if $prePrice == "SOLD" || "Sold" || "sold"}

In showlistings.tpl.php, it should be this {if $entry.prePrice == "SOLD" || "Sold" || "sold"} [but there is a problem with this one]
__________________
Chaslie
V3.1.10 dev
AUSCITY

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals

HTML Help
W3 Schools
Reply With Quote
  #7  
Old 03-30-2007, 02:23 AM
midi510's Avatar
Senior Member
 
Join Date: Mar 2007
Location: Mammoth Lakes, Ca
Posts: 135
Rep Power: 11
Default

Yea, I found that too. I changed it back, but to "sold" just so I don't have to cap it. I don't know if I'm going to ask people to change their status to sold or ask them to e-mail me and do it myself.

I used it first in viewlisting(2). I really like the SOLD!SOLD!SOLD! in red. In showlinsing(2) I want no pre or post. I still kept the replace statement. The only issue I have now is I'll have to require a price entry or It will come up SOLD! If I can get rid of the price field for ads that don't need it I'm good.

Do you know if I can make it so if a field has no entry, the title doesn't show up. I'm trying to avoid creating separate viewlisting pages for announcements and such.
__________________
Kirk
V3.1.7 Developer
May you & your loved ones be blessed with
Grace, Peace, Forgiveness, Love, Wisdom, & Joy
Reply With Quote
  #8  
Old 03-30-2007, 02:58 AM
Chaslie's Avatar
Moderator
 
Join Date: Mar 2006
Location: Great Ocean Road - Australia
Posts: 698
Rep Power: 25
Default

In default/checkout/step3.tpl.php, put this code at the start of your preprice, price and postprice table rows:

Quote:
{if $checkoutDisPrice=="Y"}
{if $section == "24" || $section == "50"}
{else}
Then at the finish of these table rows, make sure you add a:
Quote:
{/if}
Then if price is 'not required' for certain categories, the 3 fields will not be displayed. eg: Wanted to Buy category.

24 and 50 are category ID's that require price to be hidden - change these to match your site - add as many as you wish.

Now in viewlisting.tpl.php, do something like this:

Quote:
{if $viewprice=="Y"}
<tr>
<td><strong>{$smarty.const.LANG_PRICE}:</strong></td>
<td>{if $prePrice == "SOLD" || "Sold" || "sold"}
<font class="sold">SOLD</font>
{else}{$prePrice}
{/if}
<font class="red">{$listingprice|replace:'$0.00':''}</font>
{$postPrice}</td>
</tr>
{/if}
That will make sure that for those categories that don't require price, then a $0 'will not appear'.
__________________
Chaslie
V3.1.10 dev
AUSCITY

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals

HTML Help
W3 Schools
Reply With Quote
  #9  
Old 03-30-2007, 06:26 AM
midi510's Avatar
Senior Member
 
Join Date: Mar 2007
Location: Mammoth Lakes, Ca
Posts: 135
Rep Power: 11
Default

Thank you soooo much! I won't be able to work on this again until late tonight (Fri), but I'm happy I can get what I want without a horrendous amount of work.
__________________
Kirk
V3.1.7 Developer
May you & your loved ones be blessed with
Grace, Peace, Forgiveness, Love, Wisdom, & Joy
Reply With Quote
  #10  
Old 03-30-2007, 08:02 PM
Chaslie's Avatar
Moderator
 
Join Date: Mar 2006
Location: Great Ocean Road - Australia
Posts: 698
Rep Power: 25
Default

Here is the fix for showlistings.tpl.php

It must be: {if $entry.prePrice == "SOLD" || $entry.prePrice == "Sold" || $entry.prePrice == "sold"}
NOT: {if $entry.prePrice == "SOLD" || "Sold" || "sold"}

Here is the fix for viewlistings.tpl.php

It must be: {if $prePrice == "SOLD" || $prePrice == "Sold" || $prePrice == "sold"}
NOT: {if $prePrice == "SOLD" || "Sold" || "sold"}
__________________
Chaslie
V3.1.10 dev
AUSCITY

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals

HTML Help
W3 Schools
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
MOD: Price Descriptor Chaslie v3.1 Modules & Modifications 7 02-27-2008 04:23 PM
Search, maps, and sold! Crystal Pre Sales Questions 23 03-23-2007 12:26 PM
Ask sellers what their item sold for? GPM55 Pre Sales Questions 5 03-22-2007 07:07 PM
Not show price garysmith v3.1 Modules & Modifications 10 05-30-2006 06:44 AM


All times are GMT -4. The time now is 12:54 PM.


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