Jump to content

Ricerca Avanzata in homepage


doskito

Recommended Posts

Buonasera a tutti,

sto sviluppando un sito per un nuovo progetto e mi sono perso.

 

Devo inserire in Homepage una sezione di Ricerca come quella mostrata nell'allegato.

 

E' possibile? Qualcuno ha consigli da darmi o conosce un modulo che fa al caso mio?

 

Attendo reazioni, buona navigazione!

doski

post-311992-0-23159100-1353693909_thumb.jpg

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...

In pratica ho modificato il file blocksearch-top.tpl del modulo blocksearch (ho modificato solo il file del mio tema) in questo modo:

 

<!-- Block search module TOP -->
<div id="search_block_top">
 <form method="get" action="{$link->getPageLink('search')}" id="searchbox">
<label for="search_query_top"><!-- image on background --></label>

<input type="hidden" name="controller" value="search" />
<input type="hidden" name="orderby" value="position" />
<input type="hidden" name="orderway" value="desc" />

<div>
  <input placeHolder="cerca per parola chiave" class="search_query" type="text" id="search_query_top" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
</div>

<div>
  <select name="categ">
	<option value="all" {if $smarty.get.categ == "all"}selected="selected"{/if}>catalogo</option>
	{assign var='categories' value=Category::getHomeCategories($cookie->id_lang)}
	{foreach from=$categories item='category' name='categories'}
	  <option value="{$category['id_category']}" {if $smarty.get.categ == "{$category['id_category']|escape:'htmlall':'UTF-8'}"}selected="selected"{/if}>{$category['name']}</option>
	{/foreach}
  </select>
</div>
prezzo da <input type="text" name="prezzo_min" placeHolder="0 €" class="prezzo_da" value="{if isset($smarty.get.prezzo_min)}{$smarty.get.prezzo_min|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" /> a <input type="text" name="prezzo_max" placeHolder="1000 €" class="prezzo_a" value="{if isset($smarty.get.prezzo_max)}{$smarty.get.prezzo_max|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />

<input type="submit" name="submit_search" value="{l s='Search' mod='blocksearch'}" />
 </form>
</div>
{include file="$self/blocksearch-instantsearch.tpl"}

 

 

quindi ho modificato il file css blocksearch.css del mio tema:

 


#search_block_top {
 margin-bottom:10px;
}
#search_block_top form div {
 float:left;
 margin-right:20px;
}
#search_block_top form div:first-child {
 margin-left:20px;
}

#search_block_top input[type=text] {
 background:#ffffff;
 border:3px solid #dddddd;
 -moz-border-radius:3px;
 -webkit-border-radius:3px;
 border-radius:3px;
 margin:5px auto;
 padding:4px 6px;
}

#search_block_top input[type=text], #search_block_top select {
 width:164px;
}
#search_block_top input.prezzo_da, #search_block_top input.prezzo_a {
 width:84px;
}

 

ed infine il CONTROLLER e la CLASS che allego.

Il controller va caricato nella cartella OVERRIDE/CONTROLLERS/FRONT/

La class va caricata nella cartella OVERRIDE/CLASSES/

 

Spero di non aver fatto errori nei vari copia/incolla e a caricare le versioni di file..

 

Buon lavoro a tutti

doski

SearchController.php

Search.php

Edited by doskito (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...