Beispiel #1
0
 /**
  * Create a link to a category
  *
  * @param mixed $category Category object (can be an ID category, but deprecated)
  * @param string $alias
  * @param int $lang_id
  * @param string $selected_filters Url parameter to auto check filters of the module mod_block_layered
  * @param null $shop_id
  * @return string
  */
 public function getCategoryLink($category, $alias = null, $lang_id = null, $selected_filters = null, $shop_id = null)
 {
     if (!$lang_id) {
         $lang_id = JeproshopContext::getContext()->language->lang_id;
     }
     $url = "";
     //$this->getBaseLink($shop_id).$this->getLangLink($lang_id, null, $shop_id);
     if (!is_object($category)) {
         $category = new JeproshopCategoryModelCategory($category, $lang_id);
     }
     // Set available keywords
     $params = array();
     $params['id'] = $category->category_id;
     $params['rewrite'] = !$alias ? $category->link_rewrite : $alias;
     $params['meta_keywords'] = JeproshopTools::str2url($category->getFieldByLang('meta_keywords'));
     $params['meta_title'] = JeproshopTools::str2url($category->getFieldByLang('meta_title'));
     // Selected filters is used by the module blocklayered
     $selected_filters = is_null($selected_filters) ? '' : $selected_filters;
     if (empty($selected_filters)) {
         $rule = 'category_rule';
     } else {
         $rule = 'layered_rule';
         $params['selected_filters'] = $selected_filters;
     }
     return $url;
     // TODO add query$this->createUrl($rule, $lang_id, $params, $this->allow_link_rewrite, '', $shop_id);
 }