product loop feature

This commit is contained in:
Etienne Roudeix
2013-07-09 11:57:13 +02:00
parent fa66f3423f
commit 938d5a52bf
4 changed files with 76 additions and 3 deletions

View File

@@ -83,7 +83,14 @@ class Product extends BaseLoop
)
),
Argument::createBooleanTypeArgument('random', 0),
Argument::createIntListTypeArgument('exclude')
Argument::createIntListTypeArgument('exclude'),
Argument::createIntListTypeArgument('exclude_category'),
new Argument(
'feature_available',
new TypeCollection(
new Type\IntToCombinedIntsList(array('alpha', 'alpha_reverse', 'reverse', 'min_price', 'max_price', 'manual', 'manual_reverse', 'ref', 'promo', 'new'))
)
)
);
}
@@ -295,6 +302,15 @@ class Product extends BaseLoop
$search->filterById($exclude, Criteria::NOT_IN);
}
$exclude_category = $this->getExclude_category();
if (!is_null($exclude_category)) {
$search->filterByCategory(
CategoryQuery::create()->filterById($exclude_category, Criteria::IN)->find(),
Criteria::NOT_IN
);
}
/**
* Criteria::INNER_JOIN in second parameter for joinWithI18n exclude query without translation.
*