switch($type){ case self::TYPE_LOWEST_PRICE: $criteria->addSorting(newPriceSorting(SortingInterface::SORT_ASC)); break; case self::TYPE_HIGHEST_PRICE: $criteria->addSorting(newPriceSorting(SortingInterface::SORT_DESC)); break; case self::TYPE_TOPSELLER: $criteria->addSorting(newPopularitySorting(SortingInterface::SORT_DESC)); break; case self::TYPE_NEWCOMER: $criteria->addSorting(newReleaseDateSorting(SortingInterface::SORT_DESC)); break; case self::TYPE_RANDOM: $criteria->addSorting(newRandomSorting()); break; }
return$criteria; } }
break;
case self::TYPE_ARTICLE_OR_BLOG: $isBlog = (bool)$element->getConfig()->get('blog_category'); $categoryId = (int)$element->getConfig()->get('category_selection');
switch($sort){ case 'price_asc': $criteria->addSorting(newPriceSorting(SortingInterface::SORT_ASC)); break; case 'price_desc': $criteria->addSorting(newPriceSorting(SortingInterface::SORT_DESC)); break; case 'topseller': $criteria->addSorting(newPopularitySorting(SortingInterface::SORT_DESC)); break; case 'newcomer': $criteria->addSorting(newReleaseDateSorting(SortingInterface::SORT_DESC)); break; }
switch($type){ case self::TYPE_TOPSELLER: $criteria->addSorting(newPopularitySorting(SortingInterface::SORT_DESC)); break; case self::TYPE_NEWCOMER: $criteria->addSorting(newReleaseDateSorting(SortingInterface::SORT_DESC)); break; case self::TYPE_RANDOM: $criteria->addSorting(newRandomSorting()); }