PDA

View Full Version : Modification to the frontend search engine



Karl Bernburg
April 2, 2014, 01:44 PM
Hi,

I'm having trouble trying to change the search engine on the frontend in the Auto Flatty template.

What I need to do is as follows:
- Change the "Price" inputs fields to a dropdown (Where you can select fixed pricing) - For example: $10000 - $20000
- Change the "Mileage" input fields to a dropdown (Where you can select fixed mileage) - For example: 10000 - 20000

I will not use the currency dropdown but it can be there if it's needed for the search to function properly.

I am willing to pay someone to do this.

Let me know if anyone can assist me with this or if more details are needed.

Best Regards,
Karl

Karl Bernburg
April 14, 2014, 12:32 PM
Anyone?...

Dmitry
April 15, 2014, 10:53 AM
Hello Karl Bernburg,

you need to add some changes in the files.

FTP > templates > your template > tpl > blocks > field_search.tpl
FTP > templates > your template > tpl > blocks > fields_refine.tpl

- then find code:


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

------------------

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

replace inputs on the code:



<select title="{$lang.from}" name="f[{$field.Key}][from]">
<option value="0">{$lang.any|replace:'-':''}</option>
{section name=from start=1000 loop=20000 step=1000}
<option value="{$smarty.section.from.index}" {if $smarty.section.from.index == $fVal.$fKey.from}selected="selected"{/if}>{$smarty.section.from.index}</option>
{/section}
</select>

<select title="{$lang.from}" name="f[{$field.Key}][to]">
<option value="0">{$lang.any|replace:'-':''}</option>
{section name=to start=1000 loop=20000 step=1000}
<option value="{$smarty.section.to.index}" {if $smarty.section.to.index == $fVal.$fKey.to}selected="selected"{/if}>{$smarty.section.to.index}</option>
{/section}
</select>


{ section name=to start=1000 loop=20000 step=1000 }
start - first number
loop - Value to determine the number of loop iterations
step - The step value that will be used to traverse the loop array


Thanks.

Ed
September 30, 2016, 11:27 PM
Hi, Great job!!, but can not display eg 1.500,00 on the menu.

Points or commas, but helped a lot

Congratulations and Thank you!

Viktor
October 1, 2016, 08:31 AM
Hello Ed,

Please try to use: {$smarty.section.from.index|number_format:2:",":"."} and $smarty.section.to.index|number_format:2:",":"."}

Ed
October 1, 2016, 09:36 PM
Hi Viktor, Very Good Day!

This was good! you scored a goal, worked fine! perfect! :D

I owe you this.

Thank you very much

Good week for everyone here in the forum!

Sohail Zafar
March 4, 2017, 09:55 PM
How we can add like if user don't want to put price but want that people can contact him for the price and he can chose option drop down Please Contact option i try to change price field Admin Panel/Listing Fields/price/Edit Field but Field type set price how we can make it drop down so if user don't want to put price he can chose contact me option