PDA

View Full Version : Currency and unit selected by default in all search forms.



Ivan Amador
July 1, 2015, 05:51 AM
Hello!

How do I delete the "All" option in the dropmenu of the currency and units of all search forms? I just want it gets the currency and unit I have by default. Right now I only have one unit (m2) and two currencies (wants the USD by default)

Using realty_flatty v4.4.

Thanks!

IA.-

Viktor
July 1, 2015, 06:11 AM
Hello Ivan,

I have changed it on your site.

I have changed same things in 2 files: ftp://templates>>your_template>>tpl>>blocks>>fields_refine.tpl and fields_search.tpl

find conditions: {elseif $field.Type == 'mixed'} and {elseif $field.Type == 'price'}

for both fields I found selectors and removed 1st line:


<option value="0">{$lang.any}</option>

Please check.

Ivan Amador
July 1, 2015, 06:13 AM
Excellent Viktor!! great support!! ;)

Denis Raketic
February 3, 2016, 07:03 PM
i need this to know what i need to remove i want just to use unit km and euro currency doesnt need anything else

Viktor
February 5, 2016, 01:43 PM
Hello Denis,

You should change some code in file: ftp://templates>>your_template>>tpl>>blocks>>fields_search.tpl

find:



{elseif $field.Type == 'price'}
<input {if $fVal.$fKey.from}value="{$fVal.$fKey.from}"{/if} placeholder="{$lang.from}" class="numeric wauto" type="text" name="f[{$field.Key}][from]" size="9" maxlength="12" />
<input {if $fVal.$fKey.to}value="{$fVal.$fKey.to}"{/if} placeholder="{$lang.to}" class="numeric wauto" type="text" name="f[{$field.Key}][to]" size="9" maxlength="12" />

{assign var='currency_source' value='currency'|df}
<select title="{$lang.currency}" name="f[{$field.Key}][currency]">
<option value="0">{$lang.any|replace:'-':''}</option>
{foreach from=$currency_source item='currency_item'}
<option value="{$currency_item.Key}" {if $currency_item.Key == $fVal.$fKey.currency}selected="selected"{/if}>{$lang[$currency_item.pName]}</option>
{/foreach}
</select>


and replace to:



{elseif $field.Type == 'price'}
<input {if $fVal.$fKey.from}value="{$fVal.$fKey.from}"{/if} placeholder="{$lang.from}" class="numeric wauto" type="text" name="f[{$field.Key}][from]" size="9" maxlength="12" />
<input {if $fVal.$fKey.to}value="{$fVal.$fKey.to}"{/if} placeholder="{$lang.to}" class="numeric wauto" type="text" name="f[{$field.Key}][to]" size="9" maxlength="12" />

{assign var='currency_source' value='currency'|df}
{if $currency_source|@count == 1}
<span>{foreach from=$currency_source item='currency_item'}{$lang[$currency_item.pName]}{break}{/foreach}</span>
{elseif $currency_source|@count > 1}
<select title="{$lang.currency}" name="f[{$field.Key}][currency]">
<option value="0">{$lang.any|replace:'-':''}</option>
{foreach from=$currency_source item='currency_item'}
<option value="{$currency_item.Key}" {if $currency_item.Key == $fVal.$fKey.currency}selected="selected"{/if}>{$lang[$currency_item.pName]}</option>
{/foreach}
</select>
{/if}


then open file: ftp://templates>>your_template>>tpl>>blocks>>fields_search_box.tpl

find code:



{elseif $field.Type == 'price'}
<input {if $fVal.$fKey.from}value="{$fVal.$fKey.from}"{/if} placeholder="{$lang.from}" class="numeric" type="text" name="f[{$field.Key}][from]" maxlength="15" />
<input {if $fVal.$fKey.to}value="{$fVal.$fKey.to}"{/if} placeholder="{$lang.to}" class="numeric" type="text" name="f[{$field.Key}][to]" maxlength="15" />

{assign var='currency_suorce' value='currency'|df}
<select title="{$lang.currency}" name="f[{$field.Key}][currency]">
<option value="0">{$lang.any|replace:'-':''}</option>
{foreach from=$currency_suorce item='currency_item'}
<option value="{$currency_item.Key}" {if $currency_item.Key == $fVal.$fKey.currency}selected="selected"{/if}>{$lang[$currency_item.pName]}</option>
{/foreach}
</select>


and replace to:


{elseif $field.Type == 'price'}
<input {if $fVal.$fKey.from}value="{$fVal.$fKey.from}"{/if} placeholder="{$lang.from}" class="numeric" type="text" name="f[{$field.Key}][from]" maxlength="15" />
<input {if $fVal.$fKey.to}value="{$fVal.$fKey.to}"{/if} placeholder="{$lang.to}" class="numeric" type="text" name="f[{$field.Key}][to]" maxlength="15" />

{assign var='currency_suorce' value='currency'|df}
{if $currency_suorce|@count == 1}
<span>{foreach from=$currency_suorce item='currency_item'}{$lang[$currency_item.pName]}{break}{/foreach}</span>
{elseif $currency_suorce|@count > 1}
<select title="{$lang.currency}" name="f[{$field.Key}][currency]">
<option value="0">{$lang.any|replace:'-':''}</option>
{foreach from=$currency_suorce item='currency_item'}
<option value="{$currency_item.Key}" {if $currency_item.Key == $fVal.$fKey.currency}selected="selected"{/if}>{$lang[$currency_item.pName]}</option>
{/foreach}
</select>
{/if}


save and check again.

Denis Raketic
February 5, 2016, 02:14 PM
thanks thats works also i need to replace for selecting units i dont need miles only km in the "advanced search page".