On continue à adapter le template...
This commit is contained in:
@@ -30,7 +30,8 @@ class DigressiveLoop extends BaseI18nLoop implements PropelSearchLoopInterface
|
||||
{
|
||||
return new ArgumentCollection(
|
||||
Argument::createIntTypeArgument('product_id'),
|
||||
Argument::createIntTypeArgument('quantity')
|
||||
Argument::createIntTypeArgument('quantity'),
|
||||
Argument::createBooleanTypeArgument('order')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -50,6 +51,19 @@ class DigressiveLoop extends BaseI18nLoop implements PropelSearchLoopInterface
|
||||
;
|
||||
}
|
||||
|
||||
// TheCoreDev : rajout d'un tri sur la quantité
|
||||
$order = $this->getOrder();
|
||||
if (!is_null($order)) {
|
||||
switch ($order) {
|
||||
case true :
|
||||
$search->orderByQuantityFrom();
|
||||
break;
|
||||
case false :
|
||||
$search->orderByQuantityFrom(Criteria::DESC);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $search;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user