From cf0d8b6f4ef7a54f501ff4c0f56f1610cc75a232 Mon Sep 17 00:00:00 2001 From: Etienne Roudeix Date: Wed, 24 Jul 2013 11:32:32 +0200 Subject: [PATCH] loop fixe --- core/lib/Thelia/Core/Template/Loop/Category.php | 10 ++-------- core/lib/Thelia/Core/Template/Loop/Product.php | 5 +---- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/core/lib/Thelia/Core/Template/Loop/Category.php b/core/lib/Thelia/Core/Template/Loop/Category.php index db20f460e..d6172e1a1 100755 --- a/core/lib/Thelia/Core/Template/Loop/Category.php +++ b/core/lib/Thelia/Core/Template/Loop/Category.php @@ -46,12 +46,7 @@ use Thelia\Type; * - current : current id is used if you are on a category page * - not_empty : if value is 1, category and subcategories must have at least 1 product * - visible : default 1, if you want category not visible put 0 - * - order : all value available : - * * alpha : sorting by title alphabetical order - * * alpha_reverse : sorting by title alphabetical reverse order - * * reverse : sorting by position descending - * * by default results are sorting by position ascending - * - random : if 1, random results. Default value is 0 + * - order : all value available : 'alpha', 'alpha_reverse', 'manual' (default), 'manual-reverse', 'random' * - exclude : all category id you want to exclude (as for id, an integer or a "string list" can be used) * * example : @@ -87,7 +82,6 @@ class Category extends BaseLoop ), 'manual' ), - Argument::createBooleanTypeArgument('random', 0), Argument::createIntListTypeArgument('exclude') ); } @@ -190,7 +184,7 @@ class Category extends BaseLoop $loopResultRow->set("ID", $category->getId()); $loopResultRow->set("URL", $category->getUrl()); $loopResultRow->set("LINK", $category->getLink()); - $loopResultRow->set("NB_CHILD", $category->countChild()); + $loopResultRow->set("PRODUCT_COUNT", $category->countChild()); $loopResult->addRow($loopResultRow); } diff --git a/core/lib/Thelia/Core/Template/Loop/Product.php b/core/lib/Thelia/Core/Template/Loop/Product.php index 0b3a9f3c8..26f878b64 100755 --- a/core/lib/Thelia/Core/Template/Loop/Product.php +++ b/core/lib/Thelia/Core/Template/Loop/Product.php @@ -84,7 +84,7 @@ class Product extends BaseLoop new Argument( 'order', new TypeCollection( - new Type\EnumListType(array('alpha', 'alpha_reverse', 'reverse', 'min_price', 'max_price', 'manual', 'manual_reverse', 'ref', 'promo', 'new', 'random', 'given_id')) + new Type\EnumListType(array('alpha', 'alpha_reverse', 'min_price', 'max_price', 'manual', 'manual_reverse', 'ref', 'promo', 'new', 'random', 'given_id')) ), 'manual' ), @@ -264,9 +264,6 @@ class Product extends BaseLoop case "alpha_reverse": $search->addDescendingOrderByColumn(\Thelia\Model\Map\ProductI18nTableMap::TITLE); break; - case "reverse": - $search->orderByPosition(Criteria::DESC); - break; case "min_price": $search->orderBy('real_price', Criteria::ASC); break;