diff --git a/core/lib/Thelia/Core/Template/Loop/Product.php b/core/lib/Thelia/Core/Template/Loop/Product.php index 56fc3cd28..a9f697c0a 100755 --- a/core/lib/Thelia/Core/Template/Loop/Product.php +++ b/core/lib/Thelia/Core/Template/Loop/Product.php @@ -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": diff --git a/templates/smarty-sample/category.html b/templates/smarty-sample/category.html index f8da127a1..6ca05fa06 100755 --- a/templates/smarty-sample/category.html +++ b/templates/smarty-sample/category.html @@ -49,7 +49,7 @@ {loop name="product" type="product" order="ref"}

PRODUCT : #REF / #TITLE

Accessories

- {loop name="acc" type="accessory" product="#ID" order="max_price"} + {loop name="acc" type="accessory" product="#ID" order="accessory,max_price"} #REF - {/loop} {/loop} \ No newline at end of file