product loop : given id exception
This commit is contained in:
@@ -293,12 +293,12 @@ class Product extends BaseLoop
|
||||
$search->orderByNewness(Criteria::DESC);
|
||||
break;
|
||||
case "given_id":
|
||||
if (!is_null($id)) {
|
||||
foreach($id as $singleId) {
|
||||
$givenIdMatched = 'given_id_matched_' . $singleId;
|
||||
$search->withColumn(ProductTableMap::ID . "='$singleId'", $givenIdMatched);
|
||||
$search->orderBy($givenIdMatched, Criteria::DESC);
|
||||
}
|
||||
if(null === $id)
|
||||
throw new \InvalidArgumentException('Given_id order cannot be set without `id` argument');
|
||||
foreach($id as $singleId) {
|
||||
$givenIdMatched = 'given_id_matched_' . $singleId;
|
||||
$search->withColumn(ProductTableMap::ID . "='$singleId'", $givenIdMatched);
|
||||
$search->orderBy($givenIdMatched, Criteria::DESC);
|
||||
}
|
||||
break;
|
||||
case "random":
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
{loop name="product" type="product" order="ref"}
|
||||
<h3>PRODUCT : #REF / #TITLE</h3>
|
||||
<h4>Accessories</h4>
|
||||
{loop name="acc" type="accessory" product="#ID" order="max_price"}
|
||||
{loop name="acc" type="accessory" product="#ID" order="accessory,max_price"}
|
||||
#REF -
|
||||
{/loop}
|
||||
{/loop}
|
||||
Reference in New Issue
Block a user