/    Sign up×
Community /Pin to ProfileBookmark

search facility not searching correct categories

Hi all I am using a classified ads software called flynax and I am having toruble customizing a search form. in the admin you can set up categories that are called listing types. I have 4 listing types which are

  • 1. listings (this category is the default that comes with the software)

  • 2. Motor ( i set this category)

  • 3. jobs ( i set this category)

  • 4. Property ( i set this category)
  • The problem is when i do a search for lets say a ford motor and select the category from the drop down box it does not find it. I did however notice that when i click search regardless of the category i select from the drop down the next page it brings me to is the category of listings. I can see this by the url displayed after I search. that url is [url]http://www.cheapdeals.ie/listings/search-results.html[/url] where the page [url]http://www.cheapdeals.ie/motor/search-results.html[/url] should show up.

    Here are a list of the search urls

    Even if i search the motor section it still shows this link
    [url]http://www.cheapdeals.ie/listings/search-results.html[/url]

    For motor it should be
    [url]http://www.cheapdeals.ie/motor/search-results.html[/url]

    and the property should be
    [url]http://www.cheapdeals.ie/property/search-results.html[/url]

    for the jobs it should be
    [url]http://www.cheapdeals.ie/jobs/search-results.html[/url]

    then for general listings which includes everything else it is
    [url]http://www.cheapdeals.ie/listings/search-results.html[/url]

    Please see below the form being used to preform the search. Any help would be great.

    [code=html]<form method=”post” action=”{$rlBase}{if $config.mod_rewrite}{$pages.$spage_key}/{$search_results_url}.html{else}?page={$pages.$spage_key}&{$search_results_url}{/if}”>
    <input type=”hidden” name=”action” value=”search” />
    <input type=”hidden” name=”post_form_key” value=”listings_advanced” />

    <div id=”search_area”>{strip}
    <div class=”search-group”>
    {assign var=’any_replace’ value=`$smarty.ldelim`field`$smarty.rdelim`}
    <input class=”tags-autocomplete” type=”text” placeholder=”{$lang.keyword_search_hint}” name=”f[keyword_search]” />
    <select name=”f[Category_ID]”>
    <option value=””></option>
    </select>

    <script>
    {literal}

    $(‘select[name=”f[Category_ID]”]’).categoryDropdown({
    listingTypeKey: ‘listings,motor,property,jobs’,//TODOOOOOOOOOOOOOOO
    //default_selection: category_selected,
    phrases: { {/literal}
    no_categories_available: “{$lang.no_categories_available}”,
    select: “{$lang.any_field_value|replace:$any_replace:$lang.category}”,
    select_category: “{$lang.any_field_value|replace:$any_replace:$lang.category}”
    {literal} }
    });

    {/literal}
    </script>
    </div>

    {if $aHooks.search_by_distance}
    <script src=”//maps.googleapis.com/maps/api/js?libraries=places{if $smarty.const.RL_LANG_CODE != ” && $smarty.const.RL_LANG_CODE != ‘en’}&language={$smarty.const.RL_LANG_CODE}{/if}”></script>
    <div class=”location-group”>
    <input type=”text” placeholder=”{if $config.sbd_search_mode == ‘mixed’}{$lang.sbd_location_search_hint}{else}{$lang.sbd_zipcode}{/if}” name=”f[{$config.sbd_zip_field}][zip]” id=”location_search” />
    <select name=”f[{$config.sbd_zip_field}][distance]”>
    {foreach from=’,’|explode:$config.sbd_distance_items item=’distance’}
    <option {if $smarty.post.block_distance == $distance}selected=”selected”{elseif $distance == $config.sbd_default_distance}selected=”selected”{/if} value=”{$distance}”>{$distance} {if $config.sbd_default_units == ‘miles’}{$lang.sbd_mi}{else}{$lang.sbd_km}{/if}</option>
    {/foreach}
    </select>

    <input type=”hidden” name=”f[{$config.sbd_zip_field}][lat]” />
    <input type=”hidden” name=”f[{$config.sbd_zip_field}][lng]” />
    </div>
    {/if}

    <div class=”submit-group”>
    <input type=”submit” value=”{$lang.search}” />
    </div>
    {/strip}</div>
    </form>[/code]

    to post a comment
    PHP

    1 Comments(s)

    Copy linkTweet thisAlerts:
    @ginerjmDec 24.2015 — Your code is very hard to read. Try formatting it into separate lines. Also - you say it is html code but the very first line appears to reference php variables without switching into php mode first.
    ×

    Success!

    Help @midlandweb spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.2,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,
    )...