public function __construct($params = null) { parent::__construct($params); $this->hash = $this->getHash(); if (!$this->hash) { if (waRequest::get('sort')) { $this->getUser()->setSettings('shop', 'all:sort', waRequest::get('sort') . ' ' . waRequest::get('order', 'desc')); } else { $sort = $this->getUser()->getSettings('shop', 'all:sort'); if ($sort) { $sort = explode(' ', $sort); $this->sort = $_GET['sort'] = $sort[0]; $this->order = $_GET['order'] = $sort[1]; } } } $this->collection = $this->getCollection($this->hash ? implode('/', $this->hash) : ''); $info = $this->collection->getInfo(); list($this->sort, $this->order) = $this->collection->getOrderBy(); if ($info['hash'] == 'category' && empty($info['id'])) { throw new waException("Unkown category", 404); } if ($info['hash'] == 'set' && empty($info['id'])) { throw new waException("Unknown list", 404); } }