44 $this->_sType = trim($sType);
56 $sLocfnc =
"_set{$this->_sType}LocatorData";
57 $this->$sLocfnc($oLocatorTarget, $oCurrArticle);
60 $oLocatorTarget->setListType($this->_sType);
72 if (($oCategory = $oLocatorTarget->getActiveCategory())) {
73 $sOrderBy = $oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent());
74 $oIdList = $this->
_loadIdsInList($oCategory, $oCurrArticle, $sOrderBy);
77 $iPage = $this->
_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
80 $oCategory->iCntOfProd = $oIdList->count();
81 $oCategory->iProductPos = $this->
_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
86 $oCategory->toListLink = $oSeoEncoderCategory->getCategoryPageUrl($oCategory, $iPage);
93 $oCategory->nextProductLink = $oNextProduct ? $this->
_makeLink($oNextProduct->getLink(),
'') : null;
94 $oCategory->prevProductLink = $oBackProduct ? $this->
_makeLink($oBackProduct->getLink(),
'') : null;
97 $oLocatorTarget->setActiveCategory($oCategory);
100 if (($oCatTree = $oLocatorTarget->getCategoryTree())) {
101 $oLocatorTarget->setCatTreePath($oCatTree->getPath());
114 if (($oVendor = $oLocatorTarget->getActVendor())) {
115 $sVendorId = $oVendor->getId();
118 $blSeo = $myUtils->seoIsActive();
121 $oIdList =
oxNew(
"oxArticleList");
122 $oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
123 $oIdList->loadVendorIds($sVendorId);
126 $iPage = $this->
_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
130 $sAdd =
'listtype=vendor&cnid=v_' . $sVendorId;
134 $oVendor->iCntOfProd = $oIdList->count();
135 $oVendor->iProductPos = $this->
_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
137 if ($blSeo && $iPage) {
138 $oVendor->toListLink =
oxRegistry::get(
"oxSeoEncoderVendor")->getVendorPageUrl($oVendor, $iPage);
145 $oVendor->nextProductLink = $oNextProduct ? $this->
_makeLink($oNextProduct->getLink(), $sAdd) : null;
146 $oVendor->prevProductLink = $oBackProduct ? $this->
_makeLink($oBackProduct->getLink(), $sAdd) : null;
158 if (($oManufacturer = $oLocatorTarget->getActManufacturer())) {
159 $sManufacturerId = $oManufacturer->getId();
162 $blSeo = $myUtils->seoIsActive();
165 $oIdList =
oxNew(
"oxarticlelist");
166 $oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
167 $oIdList->loadManufacturerIds($sManufacturerId);
170 $iPage = $this->
_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
174 $sAdd =
'listtype=manufacturer&mnid=' . $sManufacturerId;
178 $oManufacturer->iCntOfProd = $oIdList->count();
179 $oManufacturer->iProductPos = $this->
_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
181 if ($blSeo && $iPage) {
183 $oSeoEncoderManufacturer =
oxRegistry::get(
"oxSeoEncoderManufacturer");
184 $oManufacturer->toListLink = $oSeoEncoderManufacturer->getManufacturerPageUrl($oManufacturer, $iPage);
191 $oManufacturer->nextProductLink = $oNextProduct ? $this->
_makeLink($oNextProduct->getLink(), $sAdd) : null;
192 $oManufacturer->prevProductLink = $oBackProduct ? $this->
_makeLink($oBackProduct->getLink(), $sAdd) : null;
195 $oLocatorTarget->setActiveCategory($oManufacturer);
198 if (($oManufacturerTree = $oLocatorTarget->getManufacturerTree())) {
199 $oLocatorTarget->setCatTreePath($oManufacturerTree->getPath());
212 if (($oSearchCat = $oLocatorTarget->getActSearch())) {
217 $sSearchLinkParam = rawurlencode($sSearchParam);
220 $sSearchCat = $sSearchCat ? rawurldecode($sSearchCat) : $sSearchCat;
223 $sSearchVendor = $sSearchVendor ? rawurldecode($sSearchVendor) : $sSearchVendor;
226 $sSearchManufacturer = $sSearchManufacturer ? rawurldecode($sSearchManufacturer) : $sSearchManufacturer;
229 $oIdList =
oxNew(
'oxarticlelist');
230 $oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
231 $oIdList->loadSearchIds($sSearchParam, $sSearchCat, $sSearchVendor, $sSearchManufacturer);
234 $iPage = $this->
_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
236 $sAddSearch =
"searchparam={$sSearchLinkParam}";
237 $sAddSearch .=
'&listtype=search';
239 if ($sSearchCat !== null) {
240 $sAddSearch .=
"&searchcnid={$sSearchCat}";
243 if ($sSearchVendor !== null) {
244 $sAddSearch .=
"&searchvendor={$sSearchVendor}";
247 if ($sSearchManufacturer !== null) {
248 $sAddSearch .=
"&searchmanufacturer={$sSearchManufacturer}";
252 $oSearchCat->iCntOfProd = $oIdList->count();
253 $oSearchCat->iProductPos = $this->
_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
256 $sParams = $sPageNr . ($sPageNr ?
'&' :
'') . $sAddSearch;
257 $oSearchCat->toListLink = $this->
_makeLink($oSearchCat->link, $sParams);
260 $oSearchCat->nextProductLink = $oNextProd ? $this->
_makeLink($oNextProd->getLink(), $sAddSearch) : null;
261 $oSearchCat->prevProductLink = $oBackProd ? $this->
_makeLink($oBackProd->getLink(), $sAddSearch) : null;
264 $oLocatorTarget->setSearchTitle(sprintf($sFormat, $sSearchFormParam));
265 $oLocatorTarget->setActiveCategory($oSearchCat);
279 if (($oTag = $oLocatorTarget->getActTag())) {
284 $oIdList =
oxNew(
'oxarticlelist');
287 if ($oLocatorTarget->showSorting()) {
288 $oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
291 $oIdList->getTagArticleIds($oTag->sTag, $oLang->getBaseLanguage());
294 $iPage = $this->
_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
297 $oTag->iCntOfProd = $oIdList->count();
298 $oTag->iProductPos = $this->
_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
301 $oTag->toListLink =
oxRegistry::get(
"oxSeoEncoderTag")->getTagPageUrl($oTag->sTag, $iPage);
304 $oTag->toListLink = $this->
_makeLink($oTag->link, $sPageNr);
310 if (!$myUtils->seoIsActive()) {
312 $sAddSearch =
'searchtag=' . rawurlencode($sSearchTagParameter);
313 $sAddSearch .=
'&listtype=tag';
319 $oTag->nextProductLink = $oNextProduct ? $this->
_makeLink($oNextProduct->getLink(), $sAddSearch) : null;
320 $oTag->prevProductLink = $oBackProduct ? $this->
_makeLink($oBackProduct->getLink(), $sAddSearch) : null;
322 $sTitle = $oLang->translateString(
'TAGS') .
' / ' . $oStr->htmlspecialchars($oStr->ucfirst($oTag->sTag));
323 $oLocatorTarget->setSearchTitle($sTitle);
324 $oLocatorTarget->setActiveCategory($oTag);
341 if (($oRecommList = $oLocatorTarget->getActiveRecommList())) {
344 $oIdList =
oxNew(
'oxarticlelist');
345 $oIdList->loadRecommArticleIds($oRecommList->getId(), null);
348 $iPage = $this->
_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
352 if ($sSearchRecomm !== null) {
354 $sSearchLinkRecomm = rawurlencode($sSearchRecomm);
355 $sAddSearch =
'searchrecomm=' . $sSearchLinkRecomm;
359 $oRecommList->iCntOfProd = $oIdList->count();
360 $oRecommList->iProductPos = $this->
_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
363 if ($blSeo && $iPage) {
366 $oRecommList->toListLink = $oSeoEncoderRecomm->getRecommPageUrl($oRecommList, $iPage);
370 $oRecommList->toListLink = $this->
_makeLink($oRecommList->toListLink, $sAddSearch);
374 $sAdd =
'recommid=' . $oRecommList->getId() .
'&listtype=recommlist' . ($sAddSearch ?
'&' :
'');
376 $sAdd .= $sAddSearch;
379 $oRecommList->nextProductLink = $oNextProduct ? $this->
_makeLink($oNextProduct->getLink(), $sAdd) : null;
380 $oRecommList->prevProductLink = $oBackProduct ? $this->
_makeLink($oBackProduct->getLink(), $sAdd) : null;
383 $sTitle = $oLang->translateString(
'RECOMMLIST');
384 if ($sSearchRecomm !== null) {
385 $sTitle .=
" / " . $oLang->translateString(
'RECOMMLIST_SEARCH') .
' "' . $sSearchFormRecomm .
'"';
387 $oLocatorTarget->setSearchTitle($sTitle);
388 $oLocatorTarget->setActiveCategory($oRecommList);
403 $oIdList =
oxNew(
'oxarticlelist');
404 $oIdList->setCustomSorting($sOrderBy);
407 if ($oCategory->isPriceCategory()) {
408 $oIdList->loadPriceIds($oCategory->oxcategories__oxpricefrom->value, $oCategory->oxcategories__oxpriceto->value);
410 $sActCat = $oCategory->getId();
413 if (!isset($oIdList[$oCurrArticle->getId()])) {
414 $oIdList->loadCategoryIDs($sActCat, null);
432 $sLink .= ((strpos($sLink,
'?') !==
false) ?
'&' :
'?') . $sParams;
451 $iPageNr = (int) $iPageNr;
454 if (!$iPageNr && $oIdList && $oArticle) {
455 $iNrofCatArticles = (int) $this->
getConfig()->getConfigParam(
'iNrofCatArticles');
456 $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 1;
457 $sParentIdField =
'oxarticles__oxparentid';
458 $sArticleId = $oArticle->$sParentIdField->value ? $oArticle->$sParentIdField->value : $oArticle->getId();
460 $iPageNr = floor($iPos / $iNrofCatArticles);
476 $iPageNr = (int) $iPageNr;
478 return (($iPageNr > 0) ?
"pgNr=$iPageNr" :
'');
496 $sOxid = $oArticle->oxarticles__oxparentid->value ? $oArticle->oxarticles__oxparentid->value : $oArticle->getId();
497 if ($oIdList->count() && isset($oIdList[$sOxid])) {
499 $aIds = $oIdList->arrayKeys();
502 if (array_key_exists($iPos - 1, $aIds)) {
503 $oBackProduct =
oxNew(
'oxarticle');
504 $oBackProduct->modifyCacheKey(
'_locator');
505 $oBackProduct->setNoVariantLoading(
true);
506 if ($oBackProduct->load($aIds[$iPos - 1])) {
507 $oBackProduct->setLinkType($oLocatorTarget->getLinkType());
508 $this->_oBackProduct = $oBackProduct;
512 if (array_key_exists($iPos + 1, $aIds)) {
513 $oNextProduct =
oxNew(
'oxarticle');
514 $oNextProduct->modifyCacheKey(
'_locator');
515 $oNextProduct->setNoVariantLoading(
true);
516 if ($oNextProduct->load($aIds[$iPos + 1])) {
517 $oNextProduct->setLinkType($oLocatorTarget->getLinkType());
518 $this->_oNextProduct = $oNextProduct;