[+] FO : New Responsive, Bootstrap template
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
{if $instantsearch}
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
function tryToCloseInstantSearch() {
|
||||
if ($('#old_center_column').length > 0)
|
||||
{
|
||||
$('#center_column').remove();
|
||||
$('#old_center_column').attr('id', 'center_column');
|
||||
$('#center_column').show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
instantSearchQueries = new Array();
|
||||
function stopInstantSearchQueries(){
|
||||
for(i=0;i<instantSearchQueries.length;i++) {
|
||||
instantSearchQueries[i].abort();
|
||||
}
|
||||
instantSearchQueries = new Array();
|
||||
}
|
||||
|
||||
$("#search_query_{$blocksearch_type}").keyup(function(){
|
||||
if($(this).val().length > 0){
|
||||
stopInstantSearchQueries();
|
||||
instantSearchQuery = $.ajax({
|
||||
url: '{if $search_ssl == 1}{$link->getPageLink('search', true)|addslashes}{else}{$link->getPageLink('search')|addslashes}{/if}',
|
||||
data: {
|
||||
instantSearch: 1,
|
||||
id_lang: {$cookie->id_lang},
|
||||
q: $(this).val()
|
||||
},
|
||||
dataType: 'html',
|
||||
type: 'POST',
|
||||
success: function(data){
|
||||
if($("#search_query_{$blocksearch_type}").val().length > 0)
|
||||
{
|
||||
tryToCloseInstantSearch();
|
||||
$('#center_column').attr('id', 'old_center_column');
|
||||
$('#old_center_column').after('<div id="center_column" class="' + $('#old_center_column').attr('class') + '">'+data+'</div>');
|
||||
$('#old_center_column').hide();
|
||||
// Button override
|
||||
ajaxCart.overrideButtonsInThePage();
|
||||
$("#instant_search_results a.close").click(function() {
|
||||
$("#search_query_{$blocksearch_type}").val('');
|
||||
return tryToCloseInstantSearch();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else
|
||||
tryToCloseInstantSearch();
|
||||
}
|
||||
});
|
||||
instantSearchQueries.push(instantSearchQuery);
|
||||
}
|
||||
else
|
||||
tryToCloseInstantSearch();
|
||||
});
|
||||
// ]]>
|
||||
</script>
|
||||
{/if}
|
||||
{if $ajaxsearch}
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
$('document').ready( function() {
|
||||
$("#search_query_{$blocksearch_type}")
|
||||
.autocomplete(
|
||||
'{if $search_ssl == 1}{$link->getPageLink('search', true)|addslashes}{else}{$link->getPageLink('search')|addslashes}{/if}', {
|
||||
minChars: 3,
|
||||
max: 10,
|
||||
width: 271,
|
||||
selectFirst: false,
|
||||
scroll: false,
|
||||
dataType: "json",
|
||||
formatItem: function(data, i, max, value, term) {
|
||||
return value;
|
||||
},
|
||||
parse: function(data) {
|
||||
var mytab = new Array();
|
||||
for (var i = 0; i < data.length; i++)
|
||||
mytab[mytab.length] = { data: data[i], value: data[i].cname + ' > ' + '<strong>'+data[i].pname+'</strong>' };
|
||||
return mytab;
|
||||
},
|
||||
extraParams: {
|
||||
ajaxSearch: 1,
|
||||
id_lang: {$cookie->id_lang}
|
||||
}
|
||||
}
|
||||
)
|
||||
.result(function(event, data, formatted) {
|
||||
$('#search_query_{$blocksearch_type}').val(data.pname);
|
||||
document.location.href = data.product_link;
|
||||
})
|
||||
});
|
||||
// ]]>
|
||||
</script>
|
||||
{/if}
|
||||
@@ -0,0 +1,51 @@
|
||||
{*
|
||||
* 2007-2013 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2013 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<!-- block seach mobile -->
|
||||
{if isset($hook_mobile)}
|
||||
<div class="input_search" data-role="fieldcontain">
|
||||
<form method="get" action="{$link->getPageLink('search')|escape:'html'}" id="searchbox">
|
||||
<input type="hidden" name="controller" value="search" />
|
||||
<input type="hidden" name="orderby" value="position" />
|
||||
<input type="hidden" name="orderway" value="desc" />
|
||||
<input class="search_query" type="search" id="search_query_top" name="search_query" placeholder="{l s='Search' mod='blocksearch'}" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
|
||||
</form>
|
||||
</div>
|
||||
{else}
|
||||
<!-- Block search module TOP -->
|
||||
<div id="search_block_top">
|
||||
<form method="get" action="{$link->getPageLink('search')|escape:'html'}" id="searchbox">
|
||||
<div>
|
||||
<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" />
|
||||
<input class="search_query form-control" type="text" id="search_query_top" name="search_query" placeholder="{l s='Search' mod='blocksearch'}" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
|
||||
<button type="submit" name="submit_search" class="btn btn-default button-search"><span>{l s='Search' mod='blocksearch'}</span></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{include file="$tpl_dir/modules/blocksearch/blocksearch-instantsearch.tpl"}
|
||||
{/if}
|
||||
<!-- /Block search module TOP -->
|
||||
@@ -0,0 +1,41 @@
|
||||
{*
|
||||
* 2007-2013 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2013 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<!-- Block search module -->
|
||||
<div id="search_block_left" class="block exclusive">
|
||||
<p class="title_block">{l s='Search' mod='blocksearch'}</p>
|
||||
<form method="get" action="{$link->getPageLink('search', true)|escape:'html'}" id="searchbox">
|
||||
<p class="block_content">
|
||||
<label for="search_query_block">{l s='Enter a product name' mod='blocksearch'}</label>
|
||||
<input type="hidden" name="orderby" value="position" />
|
||||
<input type="hidden" name="controller" value="search" />
|
||||
<input type="hidden" name="orderway" value="desc" />
|
||||
<input class="search_query" type="text" id="search_query_block" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
|
||||
<input type="submit" id="search_button" class="button_mini btn btn-default" value="{l s='go' mod='blocksearch'}" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
{include file="$self/blocksearch-instantsearch.tpl"}
|
||||
<!-- /Block search module -->
|
||||
Reference in New Issue
Block a user