Working : Fixture : Product add default category

This commit is contained in:
gmorel
2013-09-17 14:15:23 +02:00
parent 2bebb5697a
commit f10842069c
3 changed files with 17 additions and 4 deletions

View File

@@ -73,6 +73,7 @@ class Product extends BaseI18nLoop
)
),
Argument::createIntListTypeArgument('category'),
Argument::createIntListTypeArgument('category_default'),
Argument::createBooleanTypeArgument('new'),
Argument::createBooleanTypeArgument('promo'),
Argument::createFloatTypeArgument('min_price'),
@@ -170,9 +171,16 @@ class Product extends BaseI18nLoop
}
$category = $this->getCategory();
$categoryDefault = $this->getCategoryDefault();
if (!is_null($category)) {
$categories = CategoryQuery::create()->filterById($category, Criteria::IN)->find();
if (!is_null($category) ||!is_null($categoryDefault)) {
if (!is_null($category)) {
$categories = CategoryQuery::create()->filterById($category, Criteria::IN)->find();
}
if (!is_null($categoryDefault)) {
$categories = CategoryQuery::create()->filterById($categoryDefault, Criteria::IN)->find();
}
$depth = $this->getDepth();