From 7e92fd40f34ec9a2d8edff1dc27725ba204e0307 Mon Sep 17 00:00:00 2001 From: badsuricate Date: Fri, 11 Oct 2013 13:09:45 +0200 Subject: [PATCH] Add filter Title on ProductLoop --- core/lib/Thelia/Core/Template/Loop/Product.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/lib/Thelia/Core/Template/Loop/Product.php b/core/lib/Thelia/Core/Template/Loop/Product.php index f0bb95249..8332d45bc 100755 --- a/core/lib/Thelia/Core/Template/Loop/Product.php +++ b/core/lib/Thelia/Core/Template/Loop/Product.php @@ -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();