// Blocklayered: Fix bug with noindex

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16486 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte committed 2012-07-19 10:07:29 +00:00
1 parent bb704d1550
commit b519556a62
1 file changed
+10 -4
+10 -4
View File
@@ -1324,12 +1324,15 @@ class BlockLayered extends Module
break; break;
default: default:
if (in_array($type, $blacklist)) if (in_array($type, $blacklist))
{
if (count($val))
{ {
$smarty->assign('nobots', true); $smarty->assign('nobots', true);
$smarty->assign('nofollow', true); $smarty->assign('nofollow', true);
return; return;
} }
if (count($val) > 1) }
elseif (count($val) > 1)
{ {
$smarty->assign('nobots', true); $smarty->assign('nobots', true);
$smarty->assign('nofollow', true); $smarty->assign('nofollow', true);
@@ -3228,7 +3231,8 @@ class BlockLayered extends Module
if (!Configuration::get('PS_LAYERED_FILTER_INDEX_CAT')) if (!Configuration::get('PS_LAYERED_FILTER_INDEX_CAT'))
$blacklist[] = 'category'; $blacklist[] = 'category';
$nofollow = false; // true is in the blacklist $global_nofollow = false;
foreach ($filter_blocks as &$type_filter) foreach ($filter_blocks as &$type_filter)
{ {
$filter_name = (!empty($type_filter['url_name']) ? $type_filter['url_name'] : $type_filter['name']); $filter_name = (!empty($type_filter['url_name']) ? $type_filter['url_name'] : $type_filter['name']);
@@ -3237,7 +3241,9 @@ class BlockLayered extends Module
{ {
foreach ($type_filter['values'] as $key => $values) foreach ($type_filter['values'] as $key => $values)
{ {
$nofollow = in_array($type_filter['type'], $blacklist); $nofollow = false;
if (!empty($values['checked']) && in_array($type_filter['type'], $blacklist))
$global_nofollow = true;
$option_checked_clone_array = $option_checked_array; $option_checked_clone_array = $option_checked_array;
// If not filters checked, add parameter // If not filters checked, add parameter
@@ -3310,7 +3316,7 @@ class BlockLayered extends Module
'meta_values' => $meta_values, 'meta_values' => $meta_values,
'current_friendly_url' => $param_selected, 'current_friendly_url' => $param_selected,
'param_product_url' => $param_product_url, 'param_product_url' => $param_product_url,
'no_follow' => (!empty($param_selected) || $nofollow) 'no_follow' => (!empty($param_selected) || $global_nofollow)
); );
return $cache; return $cache;