Some Ads with prices - some Ads without

Discussion in 'Technical Support' started by RickMyles, Apr 25, 2011.

  1. RickMyles New Member

    v4.2.3 Developer - DeapSea template

    I am using my 68 installation for dual purpose.

    1. Users can place the usual ads - for this I need the price to show with each listing.

    2. Local Businesses can list in the directory pages - the listing style is identical to the Ads but for this I do not want to ask the lister for "price" or for price to show with their listing.

    Can this be achieved without the need for a totally separate installion of the script?
  2. seymourjames All Hands On Deck

    Yes - you will need to modify and place tests in showlistings.tpl, viewlistings.tpl and any plugins for adverts that show price as well.

    e.g. if $entry.price =='0.00' etc depending upon which template file you are in.


    I would say this but with TC you simply change one string so that $0 or the field left blank is whatever you want it to be - blank, free, P.O.A etc. Every advert then renders as you would expect. In your case a blank.

    If you wish to go further and not show the price label as well then you will need to look at the custom categories module (look through ClassifiedMods) or you will need to place the a test for your specific category (directory) around the price label which is displayed in your showlisting.tpl and viewlisting .tpl files.
  3. BenE Customer

    I have a similar need to have one or more categories in which listings would be business directory entries without pricing. From the brief description in the ClassifiedMods entry for it, Custom Categories sounds like just the ticket. Unfortunately, the home page link to http://ericlbarnes.com/68classifieds/modules/custom-categories/ is no longer functional: that page doesn't exist on Eric Barnes's website anymore. Got any idea where to find that module now?
  4. Mike-N-Tosh Developer & Moderator

    Nothing against the developer or the module itself, custom-categories, but even when using that, it still isn't going to work when the search results are from mixed categories. You're best bet is to do as seymorjames said to begin with and use the smarty logic to in the template to not show the price if it is $0.

    If you are wanting to eliminate the price label as well, then just put the additional smarty logic along with the {if $sDisPrice == "Y"} in your showlistings(2).tpl something like {if $sDisPrice == "Y"}{if $entry.price ne $0.00} ...existing code... {else} nothing or   {/if} {/if}
    ne is "does not equals" in smarty.
  5. BenE Customer

    Okay, thanks for the advice. I had started looking at the logic in viewlisting.tpl last night and will continue along the lines you suggest. Had there been a way to save the time of doing that, though, it would have been nice.

    Perhaps you can help me with a related question: what I was trying to determine last night was, once one is in the code in viewlisting.tpl, is there a variable already set with the current listing's category? What I'd really like to do is wrap the {if $viewprice=="Y"}{/if} block with another, outer block something like {if $category<>"Profile"}...{/if} rather than using the zero price as a flag. That would preserve advertisers' option to offer goods free (current behavior is, zero price gets displayed as "Free" -- I'm using Sigma Ocean template package) while having the ability to create a category of listings that isn't expected to have a price at all. I tried looking at the code that created the "breadcrumb" line displayed at the top of the listing but it's not clear to me (yet) what variable contains that breadcrumb string by the time one gets to displaying the price. Any hints?
  6. BenE Customer

    Sorry, make that {if $category!="Profile"}{code to display price}{/if}
  7. Mike-N-Tosh Developer & Moderator

    Honestly, if you're doing this in the viewlisting(2).tpl file... The easiest thing would be is to purchase my "Custom Viewlistings" Module. This allows you to make however many custom view listing templates that you want and assign them to categories. This includes a pre made template for not showing the price as this is the most common reason folks want a different view listing, however you can make as many as you want to.

    Although not included in the download at present, upon purchase I now include a custom smarty plugin that I email separately that works similarly to the extra fields plugin that comes with 68 Classifieds, however unlike the default plugin, it gets both the field label and the value(s). In addition, it allows several different outputs for the extra fields such as table row, unordered list, paragraph, etc..

    This allows you to place your extra fields and/or even the standard fields however you would like. So for instance if you had a real-estate category, you could group the realtors info in one area, basic property info in another, additional features etc. in another. Then for vehicles, a different look with the sellers info in one area, basic features in another and custom features in yet another, etc..
  8. sliver New Member

    Hi there,


    I also want that prices with 0€are shown as "on request" or something else.

    I made it like seymourJames wrote: e.g. if $entry.price =='0.00' in the default template in the viewlisting.tpl

    But it shows me again 0€ at my prices.

    What can I do?

    Thank You
  9. Mike-N-Tosh Developer & Moderator

    I don't think the variable value for the price is actually '0.00' which is probably why that didn't work. Find out what the o price value actually shows as for the smarty value and change it to that {if $entry.price =='actualvalueofazeroprice'}.

    Use the smarty debug while viewing the view listing page to find what the actual value of a zero price is. If you don't know how to do that, then follow the instructions in the online documentation for finding the template variables.
  10. sliver New Member

    Thanks for your help.

    entered the debug info now I see the variables
  11. mattp008 New Member

    Hi Mike,
    Can seem to find this module on your website...is it still available?

    Thanks,
    Matt
  12. Mike-N-Tosh Developer & Moderator

    This is now available from my online store and the link has also been corrected in Classifiedmods as well.

    I also updated it and it includes my custom extra fields smarty plugin.

Share This Page