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 ...
|
|||||||
|
|
LinkBack | Thread Tools | Display Modes |
|
#1
|
||||
|
||||
|
Quote:
__________________
Kirk V3.1.7 Developer May you & your loved ones be blessed withGrace, Peace, Forgiveness, Love, Wisdom, & Joy |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
||||
|
||||
|
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>
__________________
Kirk V3.1.7 Developer May you & your loved ones be blessed withGrace, Peace, Forgiveness, Love, Wisdom, & Joy Last edited by midi510; 03-30-2007 at 01:13 AM. Reason: Add example link |
|
#4
|
||||
|
||||
|
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 |
|
#5
|
||||
|
||||
|
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 withGrace, Peace, Forgiveness, Love, Wisdom, & Joy |
|
#6
|
||||
|
||||
|
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 |
|
#7
|
||||
|
||||
|
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 withGrace, Peace, Forgiveness, Love, Wisdom, & Joy |
|
#8
|
||||
|
||||
|
In default/checkout/step3.tpl.php, put this code at the start of your preprice, price and postprice table rows:
Quote:
Quote:
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:
__________________
Chaslie V3.1.10 dev AUSCITY 68 Classifieds Important Links Customer Area | Issue Tracker | Knowledge Base | User Manuals HTML Help W3 Schools |
|
#9
|
||||
|
||||
|
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 withGrace, Peace, Forgiveness, Love, Wisdom, & Joy |
|
#10
|
||||
|
||||
|
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 |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
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 |