Esempio n. 1
0
 /**
  * Get getCatHierarchyLink Alias
  *
  * @param   integer  $catid      cat id.
  * @param   string   $extension  extension.
  *
  * @since   2.2
  * @return   integer.
  */
 public function getCatHierarchyLink($catid, $extension = 'com_quick2cart')
 {
     // GETTING PARENT CATS
     $storehelper = new storeHelper();
     $parentCatArray = $storehelper->getCatParents($catid, $extension);
     $catcount = (int) count($parentCatArray);
     // GETTING ITEM ID
     $comquick2cartHelper = new comquick2cartHelper();
     $catItemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=category');
     $linkArray = array();
     $linkHtmlArray = array();
     for ($i = $catcount - 1; $i >= 0; $i--) {
         $link = 'index.php?option=com_quick2cart&view=category&prod_cat=' . $parentCatArray[$i]["id"] . '&Itemid=' . $catItemid;
         // CAT LINKS HREF
         $linkArray[] = $link = JUri::root() . substr(JRoute::_($link), strlen(JUri::base(true)) + 1);
         // CAT LINKS html code
         $linkHtmlArray[] = '<a href="' . $link . '">' . $parentCatArray[$i]["title"] . '</a>';
     }
     return $CatHierarchyLink = implode(' >', $linkHtmlArray);
 }