Merge branch 'bootstrap' of https://github.com/PrestaShop/PrestaShop into bootstrap

This commit is contained in:
Kevin Granger
2013-11-25 17:17:15 +01:00
33 changed files with 218 additions and 83 deletions
+12 -2
View File
@@ -123,7 +123,7 @@ $(document).ready(function()
hideFilterValueAction(this);
});
// To be sure there is no other events attached to the selectPrductSort, change the ID
// To be sure there is no other events attached to the selectProductSort, change the ID
var id = 1;
while ($('#selectPrductSort').length) { // Because ids are duplicated
// Unbind event change on #selectPrductSort
@@ -134,8 +134,18 @@ $(document).ready(function()
$('label[for=selectPrductSort]').attr('for', 'selectPrductSort'+id);
id++;
}
while ($('#selectProductSort').length) { // Because ids are duplicated
// Unbind event change on #selectProductSort
$('#selectProductSort').unbind('change');
$('#selectProductSort').attr('onchange', '');
$('#selectProductSort').addClass('selectProductSort');
$('#selectProductSort').attr('id', 'selectProductSort'+id);
$('label[for=selectProductSort]').attr('for', 'selectProductSort'+id);
id++;
}
// Since 1.5, event is add to .selectProductSort and not to #selectPrductSort
// Since 1.5, event is add to .selectProductSort and not to #selectProductSort
setTimeout(function() {
$('.selectProductSort').unbind('change');
}, 100);
+22 -3
View File
@@ -1347,7 +1347,9 @@ class BlockLayered extends Module
$this->context->controller->addJS(($this->_path).'blocklayered.js');
$this->context->controller->addJQueryUI('ui.slider');
$this->context->controller->addJS(_PS_JS_DIR_.'jquery/jquery-ui-1.8.10.custom.min.js');
$this->context->controller->addJQueryUI('ui.slider');
$this->context->controller->addCSS(_PS_CSS_DIR_.'jquery-ui-1.8.10.custom.css"');
$this->context->controller->addCSS(($this->_path).'blocklayered-15.css', 'all');
$this->context->controller->addJQueryPlugin('scrollTo');
@@ -1435,7 +1437,7 @@ class BlockLayered extends Module
//<![CDATA[
$(document).ready(function()
{
$(\'#selectPrductSort\').unbind(\'change\').bind(\'change\', function()
$(\'#selectProductSort\').unbind(\'change\').bind(\'change\', function()
{
reloadContent();
})
@@ -2863,7 +2865,7 @@ class BlockLayered extends Module
AND '.$alias.'.active = 1 AND '.$alias.'.`visibility` IN ("both", "catalog")';
$sql_query['group'] = ') count_products
FROM '._DB_PREFIX_.'category c
LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = c.id_category AND cl.id_lang = '.$id_lang.')
LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = c.id_category AND cl.`id_shop` = '.(int)Context::getContext()->shop->id.' and cl.id_lang = '.$id_lang.')
WHERE c.nleft > '.(int)$parent->nleft.'
AND c.nright < '.(int)$parent->nright.'
'.($depth ? 'AND c.level_depth <= '.($parent->level_depth+(int)$depth) : '').'
@@ -3166,6 +3168,23 @@ class BlockLayered extends Module
if (isset($selected_filters['id_feature'][$feature['id_feature_value']]))
$feature_array[$feature['id_feature']]['values'][$feature['id_feature_value']]['checked'] = true;
}
//Natural sort
foreach ($feature_array as $key => $value)
{
$temp = array();
foreach ($feature_array[$key]['values'] as $keyint => $valueint)
$temp[$keyint] = $valueint['name'];
natcasesort($temp);
$temp2 = array();
foreach ($temp as $keytemp => $valuetemp)
$temp2[$keytemp] = $feature_array[$key]['values'][$keytemp];
$feature_array[$key]['values'] = $temp2;
}
$filter_blocks = array_merge($filter_blocks, $feature_array);
}
break;
+2 -2
View File
@@ -94,7 +94,7 @@ param_product_url = '';
{if $value.nbr || !$hide_0_values}
<li class="nomargin {if $smarty.foreach.fe.index >= $filter.filter_show_limit}hiddable{/if}">
{if isset($filter.is_color_group) && $filter.is_color_group}
<input class="color-option {if isset($value.checked) && $value.checked}on{/if} {if !$value.nbr}disable{/if}" type="button" name="layered_{$filter.type_lite}_{$id_value}" rel="{$id_value}_{$filter.id_key}" id="layered_id_attribute_group_{$id_value}" {if !$value.nbr}disabled="disabled"{/if} style="background: {if isset($value.color)}{if file_exists($col_img_dir|cat:$id_value|cat:'.jpg')}url({$img_col_dir}{$id_value}.jpg){else}{$value.color}{/if}{else}#CCC{/if};" />
<input class="color-option {if isset($value.checked) && $value.checked}on{/if} {if !$value.nbr}disable{/if}" type="button" name="layered_{$filter.type_lite}_{$id_value}" rel="{$id_value}_{$filter.id_key}" id="layered_id_attribute_group_{$id_value}" {if !$value.nbr}disabled="disabled"{/if} style="background: {if isset($value.color)}{if file_exists($col_img_dir|cat:$id_value|cat:'.jpg')}url({$img_col_dir}{$id_value}.jpg){else}{$value.color}{/if}{else}#CCC{/if};" title="{$value.name|escape:html:'UTF-8'}" />
{if isset($value.checked) && $value.checked}<input type="hidden" name="layered_{$filter.type_lite}_{$id_value}" value="{$id_value}" />{/if}
{else}
<input type="checkbox" class="checkbox" name="layered_{$filter.type_lite}_{$id_value}" id="layered_{$filter.type_lite}{if $id_value || $filter.type == 'quantity'}_{$id_value}{/if}" value="{$id_value}{if $filter.id_key}_{$filter.id_key}{/if}"{if isset($value.checked)} checked="checked"{/if}{if !$value.nbr} disabled="disabled"{/if} />
@@ -115,7 +115,7 @@ param_product_url = '';
{if $value.nbr || !$hide_0_values}
<li class="nomargin {if $smarty.foreach.fe.index >= $filter.filter_show_limit}hiddable{/if}">
{if isset($filter.is_color_group) && $filter.is_color_group}
<input class="radio color-option {if isset($value.checked) && $value.checked}on{/if} {if !$value.nbr}disable{/if}" type="button" name="layered_{$filter.type_lite}_{$id_value}" rel="{$id_value}_{$filter.id_key}" id="layered_id_attribute_group_{$id_value}" {if !$value.nbr}disabled="disabled"{/if} style="background: {if isset($value.color)}{if file_exists($col_img_dir|cat:$id_value|cat:'.jpg')}url({$img_col_dir}{$id_value}.jpg){else}{$value.color}{/if}{else}#CCC{/if};"/>
<input class="radio color-option {if isset($value.checked) && $value.checked}on{/if} {if !$value.nbr}disable{/if}" type="button" name="layered_{$filter.type_lite}_{$id_value}" rel="{$id_value}_{$filter.id_key}" id="layered_id_attribute_group_{$id_value}" {if !$value.nbr}disabled="disabled"{/if} style="background: {if isset($value.color)}{if file_exists($col_img_dir|cat:$id_value|cat:'.jpg')}url({$img_col_dir}{$id_value}.jpg){else}{$value.color}{/if}{else}#CCC{/if};" title="{$value.name|escape:html:'UTF-8'}"/>
{if isset($value.checked) && $value.checked}<input type="hidden" name="layered_{$filter.type_lite}_{$id_value}" value="{$id_value}" />{/if}
{else}
<input type="radio" class="radio layered_{$filter.type_lite}_{$id_value}" name="layered_{$filter.type_lite}{if $filter.id_key}_{$filter.id_key}{else}_1{/if}" id="layered_{$filter.type_lite}{if $id_value || $filter.type == 'quantity'}_{$id_value}{if $filter.id_key}_{$filter.id_key}{/if}{/if}" value="{$id_value}{if $filter.id_key}_{$filter.id_key}{/if}"{if isset($value.checked)} checked="checked"{/if}{if !$value.nbr} disabled="disabled"{/if} />