/**
  * @param \Enlight_Controller_Request_Request $request
  */
 public function __construct(\Enlight_Controller_Request_Request $request)
 {
     $params = $request->getParams();
     $ids = array();
     foreach ($params as $paramName => $paramValue) {
         if (strpos($paramName, self::PARAM_NAME) !== 0) {
             continue;
         }
         $parts = explode('_', $paramName);
         if (count($parts) !== 3) {
             $ids = explode('|', $paramValue);
             break;
         }
         $ids[$parts[2]] = explode('|', $paramValue);
     }
     if (!$ids) {
         return;
     }
     if (!$request->has(self::PARAM_NAME)) {
         $this->isGrouped = true;
     }
     $this->requestedVariantIds = $ids;
 }
 /**
  * @param Request $request
  * @param ShopContextInterface $context
  * @return Criteria
  */
 private function getSearchCriteria(Request $request, ShopContextInterface $context)
 {
     if (!$request->has('sSort')) {
         $request->setParam('sSort', StoreFrontCriteriaFactory::SORTING_SEARCH_RANKING);
     }
     $criteria = $this->createCriteriaFromRequest($request, $context);
     if (!$criteria->hasCondition('category')) {
         $categoryId = $context->getShop()->getCategory()->getId();
         $criteria->addBaseCondition(new CategoryCondition([$categoryId]));
     }
     return $criteria;
 }