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())) {
75 if ($oLocatorTarget->showSorting()) {
76 $sOrderBy = $oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent());
79 $oIdList = $this->
_loadIdsInList($oCategory, $oCurrArticle, $sOrderBy);
82 $iPage = $this->
_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
85 $oCategory->iCntOfProd = $oIdList->count();
86 $oCategory->iProductPos = $this->
_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
91 $oCategory->toListLink = $oSeoEncoderCategory->getCategoryPageUrl($oCategory, $iPage);
98 $oCategory->nextProductLink = $oNextProduct ? $this->
_makeLink($oNextProduct->getLink(),
'') : null;
99 $oCategory->prevProductLink = $oBackProduct ? $this->
_makeLink($oBackProduct->getLink(),
'') : null;
102 $oLocatorTarget->setActiveCategory($oCategory);
105 if (($oCatTree = $oLocatorTarget->getCategoryTree())) {
106 $oLocatorTarget->setCatTreePath($oCatTree->getPath());
119 if (($oVendor = $oLocatorTarget->getActVendor())) {
120 $sVendorId = $oVendor->getId();
123 $blSeo = $myUtils->seoIsActive();
126 $oIdList =
oxNew(
"oxArticleList");
127 if ($oLocatorTarget->showSorting()) {
128 $oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
130 $oIdList->loadVendorIds($sVendorId);
133 $iPage = $this->
_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
137 $sAdd =
'listtype=vendor&cnid=v_' . $sVendorId;
141 $oVendor->iCntOfProd = $oIdList->count();
142 $oVendor->iProductPos = $this->
_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
144 if ($blSeo && $iPage) {
145 $oVendor->toListLink =
oxRegistry::get(
"oxSeoEncoderVendor")->getVendorPageUrl($oVendor, $iPage);
152 $oVendor->nextProductLink = $oNextProduct ? $this->
_makeLink($oNextProduct->getLink(), $sAdd) : null;
153 $oVendor->prevProductLink = $oBackProduct ? $this->
_makeLink($oBackProduct->getLink(), $sAdd) : null;
165 if (($oManufacturer = $oLocatorTarget->getActManufacturer())) {
166 $sManufacturerId = $oManufacturer->getId();
169 $blSeo = $myUtils->seoIsActive();
172 $oIdList =
oxNew(
"oxarticlelist");
173 if ($oLocatorTarget->showSorting()) {
174 $oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
176 $oIdList->loadManufacturerIds($sManufacturerId);
179 $iPage = $this->
_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
183 $sAdd =
'listtype=manufacturer&mnid=' . $sManufacturerId;
187 $oManufacturer->iCntOfProd = $oIdList->count();
188 $oManufacturer->iProductPos = $this->
_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
190 if ($blSeo && $iPage) {
192 $oSeoEncoderManufacturer =
oxRegistry::get(
"oxSeoEncoderManufacturer");
193 $oManufacturer->toListLink = $oSeoEncoderManufacturer->getManufacturerPageUrl($oManufacturer, $iPage);
200 $oManufacturer->nextProductLink = $oNextProduct ? $this->
_makeLink($oNextProduct->getLink(), $sAdd) : null;
201 $oManufacturer->prevProductLink = $oBackProduct ? $this->
_makeLink($oBackProduct->getLink(), $sAdd) : null;
204 $oLocatorTarget->setActiveCategory($oManufacturer);
207 if (($oManufacturerTree = $oLocatorTarget->getManufacturerTree())) {
208 $oLocatorTarget->setCatTreePath($oManufacturerTree->getPath());
221 if (($oSearchCat = $oLocatorTarget->getActSearch())) {
226 $sSearchLinkParam = rawurlencode($sSearchParam);
229 $sSearchCat = $sSearchCat ? rawurldecode($sSearchCat) : $sSearchCat;
232 $sSearchVendor = $sSearchVendor ? rawurldecode($sSearchVendor) : $sSearchVendor;
235 $sSearchManufacturer = $sSearchManufacturer ? rawurldecode($sSearchManufacturer) : $sSearchManufacturer;
238 $oIdList =
oxNew(
'oxarticlelist');
239 if ($oLocatorTarget->showSorting()) {
240 $oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
242 $oIdList->loadSearchIds($sSearchParam, $sSearchCat, $sSearchVendor, $sSearchManufacturer);
245 $iPage = $this->
_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
247 $sAddSearch =
"searchparam={$sSearchLinkParam}";
248 $sAddSearch .=
'&listtype=search';
250 if ($sSearchCat !== null) {
251 $sAddSearch .=
"&searchcnid={$sSearchCat}";
254 if ($sSearchVendor !== null) {
255 $sAddSearch .=
"&searchvendor={$sSearchVendor}";
258 if ($sSearchManufacturer !== null) {
259 $sAddSearch .=
"&searchmanufacturer={$sSearchManufacturer}";
263 $oSearchCat->iCntOfProd = $oIdList->count();
264 $oSearchCat->iProductPos = $this->
_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
267 $sParams = $sPageNr . ($sPageNr ?
'&' :
'') . $sAddSearch;
268 $oSearchCat->toListLink = $this->
_makeLink($oSearchCat->link, $sParams);
271 $oSearchCat->nextProductLink = $oNextProd ? $this->
_makeLink($oNextProd->getLink(), $sAddSearch) : null;
272 $oSearchCat->prevProductLink = $oBackProd ? $this->
_makeLink($oBackProd->getLink(), $sAddSearch) : null;
275 $oLocatorTarget->setSearchTitle(sprintf($sFormat, $sSearchFormParam));
276 $oLocatorTarget->setActiveCategory($oSearchCat);
290 if (($oTag = $oLocatorTarget->getActTag())) {
295 $oIdList =
oxNew(
'oxarticlelist');
298 if ($oLocatorTarget->showSorting()) {
299 $oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
302 $oIdList->getTagArticleIds($oTag->sTag, $oLang->getBaseLanguage());
305 $iPage = $this->
_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
308 $oTag->iCntOfProd = $oIdList->count();
309 $oTag->iProductPos = $this->
_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
312 $oTag->toListLink =
oxRegistry::get(
"oxSeoEncoderTag")->getTagPageUrl($oTag->sTag, $iPage);
315 $oTag->toListLink = $this->
_makeLink($oTag->link, $sPageNr);
321 if (!$myUtils->seoIsActive()) {
323 $sAddSearch =
'searchtag=' . rawurlencode($sSearchTagParameter);
324 $sAddSearch .=
'&listtype=tag';
330 $oTag->nextProductLink = $oNextProduct ? $this->
_makeLink($oNextProduct->getLink(), $sAddSearch) : null;
331 $oTag->prevProductLink = $oBackProduct ? $this->
_makeLink($oBackProduct->getLink(), $sAddSearch) : null;
333 $sTitle = $oLang->translateString(
'TAGS') .
' / ' . $oStr->htmlspecialchars($oStr->ucfirst($oTag->sTag));
334 $oLocatorTarget->setSearchTitle($sTitle);
335 $oLocatorTarget->setActiveCategory($oTag);
352 if (($oRecommList = $oLocatorTarget->getActiveRecommList())) {
355 $oIdList =
oxNew(
'oxarticlelist');
356 $oIdList->loadRecommArticleIds($oRecommList->getId(), null);
359 $iPage = $this->
_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
363 if ($sSearchRecomm !== null) {
365 $sSearchLinkRecomm = rawurlencode($sSearchRecomm);
366 $sAddSearch =
'searchrecomm=' . $sSearchLinkRecomm;
370 $oRecommList->iCntOfProd = $oIdList->count();
371 $oRecommList->iProductPos = $this->
_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
374 if ($blSeo && $iPage) {
377 $oRecommList->toListLink = $oSeoEncoderRecomm->getRecommPageUrl($oRecommList, $iPage);
381 $oRecommList->toListLink = $this->
_makeLink($oRecommList->toListLink, $sAddSearch);
385 $sAdd =
'recommid=' . $oRecommList->getId() .
'&listtype=recommlist' . ($sAddSearch ?
'&' :
'');
387 $sAdd .= $sAddSearch;
390 $oRecommList->nextProductLink = $oNextProduct ? $this->
_makeLink($oNextProduct->getLink(), $sAdd) : null;
391 $oRecommList->prevProductLink = $oBackProduct ? $this->
_makeLink($oBackProduct->getLink(), $sAdd) : null;
394 $sTitle = $oLang->translateString(
'RECOMMLIST');
395 if ($sSearchRecomm !== null) {
396 $sTitle .=
" / " . $oLang->translateString(
'RECOMMLIST_SEARCH') .
' "' . $sSearchFormRecomm .
'"';
398 $oLocatorTarget->setSearchTitle($sTitle);
399 $oLocatorTarget->setActiveCategory($oRecommList);
414 $oIdList =
oxNew(
'oxarticlelist');
415 $oIdList->setCustomSorting($sOrderBy);
418 if ($oCategory->isPriceCategory()) {
419 $oIdList->loadPriceIds($oCategory->oxcategories__oxpricefrom->value, $oCategory->oxcategories__oxpriceto->value);
421 $sActCat = $oCategory->getId();
424 if (!isset($oIdList[$oCurrArticle->getId()])) {
425 $oIdList->loadCategoryIDs($sActCat, null);
443 $sLink .= ((strpos($sLink,
'?') !==
false) ?
'&' :
'?') . $sParams;
462 $iPageNr = (int) $iPageNr;
465 if (!$iPageNr && $oIdList && $oArticle) {
466 $iNrofCatArticles = (int) $this->
getConfig()->getConfigParam(
'iNrofCatArticles');
467 $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 1;
468 $sParentIdField =
'oxarticles__oxparentid';
469 $sArticleId = $oArticle->$sParentIdField->value ? $oArticle->$sParentIdField->value : $oArticle->getId();
471 $iPageNr = floor($iPos / $iNrofCatArticles);
487 $iPageNr = (int) $iPageNr;
489 return (($iPageNr > 0) ?
"pgNr=$iPageNr" :
'');
507 $sOxid = $oArticle->oxarticles__oxparentid->value ? $oArticle->oxarticles__oxparentid->value : $oArticle->getId();
508 if ($oIdList->count() && isset($oIdList[$sOxid])) {
510 $aIds = $oIdList->arrayKeys();
513 if (array_key_exists($iPos - 1, $aIds)) {
514 $oBackProduct =
oxNew(
'oxarticle');
515 $oBackProduct->modifyCacheKey(
'_locator');
516 $oBackProduct->setNoVariantLoading(
true);
517 if ($oBackProduct->load($aIds[$iPos - 1])) {
518 $oBackProduct->setLinkType($oLocatorTarget->getLinkType());
519 $this->_oBackProduct = $oBackProduct;
523 if (array_key_exists($iPos + 1, $aIds)) {
524 $oNextProduct =
oxNew(
'oxarticle');
525 $oNextProduct->modifyCacheKey(
'_locator');
526 $oNextProduct->setNoVariantLoading(
true);
527 if ($oNextProduct->load($aIds[$iPos + 1])) {
528 $oNextProduct->setLinkType($oLocatorTarget->getLinkType());
529 $this->_oNextProduct = $oNextProduct;