Add filter Title on ProductLoop

This commit is contained in:
badsuricate
2013-10-11 13:09:45 +02:00
parent 6d5768c16f
commit 7e92fd40f3

View File

@@ -87,6 +87,7 @@ class Product extends BaseI18nLoop
Argument::createIntTypeArgument('depth', 1),
Argument::createBooleanOrBothTypeArgument('visible', 1),
Argument::createIntTypeArgument('currency'),
Argument::createAnyTypeArgument('title'),
new Argument(
'order',
new TypeCollection(
@@ -171,6 +172,17 @@ class Product extends BaseI18nLoop
$search->filterByRef($ref, Criteria::IN);
}
$title = $this->getTitle();
if(!is_null($title)){
$search->where(" CASE WHEN NOT ISNULL(`requested_locale_i18n`.ID) THEN `requested_locale_i18n`.`TITLE` ELSE `default_locale_i18n`.`TITLE` END ".Criteria::LIKE." ?", "%".$title."%", \PDO::PARAM_STR);
}
$category = $this->getCategory();
$categoryDefault = $this->getCategoryDefault();