本文整理汇总了PHP中oxUBase::getActiveCategory方法的典型用法代码示例。如果您正苦于以下问题:PHP oxUBase::getActiveCategory方法的具体用法?PHP oxUBase::getActiveCategory怎么用?PHP oxUBase::getActiveCategory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oxUBase
的用法示例。
在下文中一共展示了oxUBase::getActiveCategory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _setListLocatorData
/**
* Sets details locator data for articles that came from regular list.
*
* @param oxUBase $oLocatorTarget view object
* @param oxArticle $oCurrArticle current article
*/
protected function _setListLocatorData($oLocatorTarget, $oCurrArticle)
{
// if no active category is loaded - lets check for category passed by post/get
if ($oCategory = $oLocatorTarget->getActiveCategory()) {
$sOrderBy = null;
if ($oLocatorTarget->showSorting()) {
$sOrderBy = $oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent());
}
$oIdList = $this->_loadIdsInList($oCategory, $oCurrArticle, $sOrderBy);
//page number
$iPage = $this->_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
// setting product position in list, amount of articles etc
$oCategory->iCntOfProd = $oIdList->count();
$oCategory->iProductPos = $this->_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
if (oxRegistry::getUtils()->seoIsActive() && $iPage) {
/** @var oxSeoEncoderCategory $oSeoEncoderCategory */
$oSeoEncoderCategory = oxRegistry::get("oxSeoEncoderCategory");
$oCategory->toListLink = $oSeoEncoderCategory->getCategoryPageUrl($oCategory, $iPage);
} else {
$oCategory->toListLink = $this->_makeLink($oCategory->getLink(), $this->_getPageNumber($iPage));
}
$oNextProduct = $this->_oNextProduct;
$oBackProduct = $this->_oBackProduct;
$oCategory->nextProductLink = $oNextProduct ? $this->_makeLink($oNextProduct->getLink(), '') : null;
$oCategory->prevProductLink = $oBackProduct ? $this->_makeLink($oBackProduct->getLink(), '') : null;
// active category
$oLocatorTarget->setActiveCategory($oCategory);
// category path
if ($oCatTree = $oLocatorTarget->getCategoryTree()) {
$oLocatorTarget->setCatTreePath($oCatTree->getPath());
}
}
}