43 $this->_sType = trim( $sType );
57 $sLocfnc =
"_set{$this->_sType}LocatorData";
58 $this->$sLocfnc( $oLocatorTarget, $oCurrArticle );
61 $oLocatorTarget->setListType( $this->_sType );
75 if ( ( $oCategory = $oLocatorTarget->getActiveCategory() ) ) {
78 if ( $oLocatorTarget->showSorting() ) {
79 $sOrderBy = $oLocatorTarget->getSortingSql( $oLocatorTarget->getSortIdent() );
82 $oIdList = $this->
_loadIdsInList( $oCategory, $oCurrArticle, $sOrderBy );
85 $iPage = $this->
_findActPageNumber( $oLocatorTarget->getActPage(), $oIdList, $oCurrArticle );
88 $oCategory->iCntOfProd = $oIdList->count();
89 $oCategory->iProductPos = $this->
_getProductPos( $oCurrArticle, $oIdList, $oLocatorTarget );
92 $oCategory->toListLink =
oxRegistry::get(
"oxSeoEncoderCategory")->getCategoryPageUrl( $oCategory, $iPage );
97 $oCategory->nextProductLink = $this->_oNextProduct?$this->
_makeLink( $this->_oNextProduct->getLink(),
'' ):null;
98 $oCategory->prevProductLink = $this->_oBackProduct?$this->
_makeLink( $this->_oBackProduct->getLink(),
'' ):null;
101 $oLocatorTarget->setActiveCategory( $oCategory );
104 if ( ( $oCatTree = $oLocatorTarget->getCategoryTree() ) ) {
105 $oLocatorTarget->setCatTreePath( $oCatTree->getPath() );
120 if ( ( $oVendor = $oLocatorTarget->getActVendor() ) ) {
121 $sVendorId = $oVendor->getId();
124 $blSeo = $myUtils->seoIsActive();
127 $oIdList =
oxNew(
"oxArticleList" );
128 if ( $oLocatorTarget->showSorting() ) {
129 $oIdList->setCustomSorting( $oLocatorTarget->getSortingSql( $oLocatorTarget->getSortIdent() ) );
131 $oIdList->loadVendorIds( $sVendorId );
134 $iPage = $this->
_findActPageNumber( $oLocatorTarget->getActPage(), $oIdList, $oCurrArticle );
138 $sAdd =
'listtype=vendor&cnid=v_'.$sVendorId;
142 $oVendor->iCntOfProd = $oIdList->count();
143 $oVendor->iProductPos = $this->
_getProductPos( $oCurrArticle, $oIdList, $oLocatorTarget );
145 if ( $blSeo && $iPage ) {
146 $oVendor->toListLink =
oxRegistry::get(
"oxSeoEncoderVendor")->getVendorPageUrl( $oVendor, $iPage );
151 $oVendor->nextProductLink = $this->_oNextProduct?$this->
_makeLink( $this->_oNextProduct->getLink(), $sAdd ):null;
152 $oVendor->prevProductLink = $this->_oBackProduct?$this->
_makeLink( $this->_oBackProduct->getLink(), $sAdd ):null;
166 if ( ( $oManufacturer = $oLocatorTarget->getActManufacturer() ) ) {
167 $sManufacturerId = $oManufacturer->getId();
170 $blSeo = $myUtils->seoIsActive();
173 $oIdList =
oxNew(
"oxarticlelist" );
174 if ( $oLocatorTarget->showSorting() ) {
175 $oIdList->setCustomSorting( $oLocatorTarget->getSortingSql( $oLocatorTarget->getSortIdent() ) );
177 $oIdList->loadManufacturerIds( $sManufacturerId );
180 $iPage = $this->
_findActPageNumber( $oLocatorTarget->getActPage(), $oIdList, $oCurrArticle );
184 $sAdd =
'listtype=manufacturer&mnid='.$sManufacturerId;
188 $oManufacturer->iCntOfProd = $oIdList->count();
189 $oManufacturer->iProductPos = $this->
_getProductPos( $oCurrArticle, $oIdList, $oLocatorTarget );
191 if ( $blSeo && $iPage ) {
192 $oManufacturer->toListLink =
oxRegistry::get(
"oxSeoEncoderManufacturer")->getManufacturerPageUrl( $oManufacturer, $iPage );
197 $oManufacturer->nextProductLink = $this->_oNextProduct?$this->
_makeLink( $this->_oNextProduct->getLink(), $sAdd ):null;
198 $oManufacturer->prevProductLink = $this->_oBackProduct?$this->
_makeLink( $this->_oBackProduct->getLink(), $sAdd ):null;
201 $oLocatorTarget->setActiveCategory( $oManufacturer );
204 if ( ( $oManufacturerTree = $oLocatorTarget->getManufacturerTree() ) ) {
205 $oLocatorTarget->setCatTreePath( $oManufacturerTree->getPath() );
220 if ( ( $oSearchCat = $oLocatorTarget->getActSearch() ) ) {
225 $sSearchLinkParam = rawurlencode( $sSearchParam );
228 $sSearchCat = $sSearchCat?rawurldecode( $sSearchCat ):$sSearchCat;
231 $sSearchVendor = $sSearchVendor?rawurldecode( $sSearchVendor ):$sSearchVendor;
234 $sSearchManufacturer = $sSearchManufacturer?rawurldecode( $sSearchManufacturer ):$sSearchManufacturer;
237 $oIdList =
oxNew(
'oxarticlelist' );
238 if ( $oLocatorTarget->showSorting() ) {
239 $oIdList->setCustomSorting( $oLocatorTarget->getSortingSql( $oLocatorTarget->getSortIdent() ) );
241 $oIdList->loadSearchIds( $sSearchParam, $sSearchCat, $sSearchVendor, $sSearchManufacturer );
244 $iPage = $this->
_findActPageNumber( $oLocatorTarget->getActPage(), $oIdList, $oCurrArticle );
246 $sAddSearch =
"searchparam={$sSearchLinkParam}";
247 $sAddSearch .=
'&listtype=search';
249 if ( $sSearchCat !== null ) {
250 $sAddSearch .=
"&searchcnid={$sSearchCat}";
253 if ( $sSearchVendor !== null ) {
254 $sAddSearch .=
"&searchvendor={$sSearchVendor}";
257 if ( $sSearchManufacturer !== null ) {
258 $sAddSearch .=
"&searchmanufacturer={$sSearchManufacturer}";
262 $oSearchCat->iCntOfProd = $oIdList->count();
263 $oSearchCat->iProductPos = $this->
_getProductPos( $oCurrArticle, $oIdList, $oLocatorTarget );
266 $oSearchCat->toListLink = $this->
_makeLink( $oSearchCat->link, $sPageNr.($sPageNr?
'&':
'').$sAddSearch );
267 $oSearchCat->nextProductLink = $this->_oNextProduct?$this->
_makeLink( $this->_oNextProduct->getLink(), $sAddSearch ):null;
268 $oSearchCat->prevProductLink = $this->_oBackProduct?$this->
_makeLink( $this->_oBackProduct->getLink(), $sAddSearch ):null;
271 $oLocatorTarget->setSearchTitle( sprintf( $sFormat, $sSearchFormParam ) );
272 $oLocatorTarget->setActiveCategory( $oSearchCat );
286 if ( ( $oTag = $oLocatorTarget->getActTag() ) ) {
291 $oIdList =
oxNew(
'oxarticlelist' );
294 if ( $oLocatorTarget->showSorting() ) {
295 $oIdList->setCustomSorting( $oLocatorTarget->getSortingSql( $oLocatorTarget->getSortIdent() ) );
298 $oIdList->getTagArticleIds( $oTag->sTag, $oLang->getBaseLanguage() );
301 $iPage = $this->
_findActPageNumber( $oLocatorTarget->getActPage(), $oIdList, $oCurrArticle );
304 $oTag->iCntOfProd = $oIdList->count();
305 $oTag->iProductPos = $this->
_getProductPos( $oCurrArticle, $oIdList, $oLocatorTarget );
308 $oTag->toListLink =
oxRegistry::get(
"oxSeoEncoderTag")->getTagPageUrl( $oTag->sTag, $iPage );
311 $oTag->toListLink = $this->
_makeLink( $oTag->link, $sPageNr );
316 if ( !$myUtils->seoIsActive() ) {
317 $sAddSearch =
'searchtag='.rawurlencode(
oxRegistry::getConfig()->getRequestParameter(
'searchtag',
true ) );
318 $sAddSearch .=
'&listtype=tag';
321 $oTag->nextProductLink = $this->_oNextProduct?$this->
_makeLink( $this->_oNextProduct->getLink(), $sAddSearch ):null;
322 $oTag->prevProductLink = $this->_oBackProduct?$this->
_makeLink( $this->_oBackProduct->getLink(), $sAddSearch ):null;
324 $oLocatorTarget->setSearchTitle( $oLang->translateString(
'TAGS').
' / '.$oStr->htmlspecialchars( $oStr->ucfirst( $oTag->sTag ) ) );
325 $oLocatorTarget->setActiveCategory( $oTag );
342 if ( ( $oRecommList = $oLocatorTarget->getActiveRecommList() ) ) {
345 $oIdList =
oxNew(
'oxarticlelist' );
346 $oIdList->loadRecommArticleIds( $oRecommList->getId(), null );
349 $iPage = $this->
_findActPageNumber( $oLocatorTarget->getActPage(), $oIdList, $oCurrArticle );
353 if ( $sSearchRecomm !== null ) {
355 $sSearchLinkRecomm = rawurlencode( $sSearchRecomm );
356 $sAddSearch =
'searchrecomm='.$sSearchLinkRecomm;
360 $oRecommList->iCntOfProd = $oIdList->count();
361 $oRecommList->iProductPos = $this->
_getProductPos( $oCurrArticle, $oIdList, $oLocatorTarget );
364 if ( $blSeo && $iPage ) {
365 $oRecommList->toListLink =
oxRegistry::get(
"oxSeoEncoderRecomm")->getRecommPageUrl( $oRecommList, $iPage );
369 $oRecommList->toListLink = $this->
_makeLink( $oRecommList->toListLink, $sAddSearch );
373 $sAdd =
'recommid='.$oRecommList->getId().
'&listtype=recommlist'.($sAddSearch?
'&':
'');
375 $sAdd .= $sAddSearch;
376 $oRecommList->nextProductLink = $this->_oNextProduct?$this->
_makeLink( $this->_oNextProduct->getLink(), $sAdd ):null;
377 $oRecommList->prevProductLink = $this->_oBackProduct?$this->
_makeLink( $this->_oBackProduct->getLink(), $sAdd ):null;
380 $sTitle = $oLang->translateString(
'RECOMMLIST');
381 if ( $sSearchRecomm !== null ) {
382 $sTitle .=
" / ".$oLang->translateString(
'RECOMMLIST_SEARCH').
' "'.$sSearchFormRecomm.
'"';
384 $oLocatorTarget->setSearchTitle( $sTitle );
385 $oLocatorTarget->setActiveCategory( $oRecommList );
400 $oIdList =
oxNew(
'oxarticlelist' );
401 $oIdList->setCustomSorting( $sOrderBy ) ;
404 if ( $oCategory->isPriceCategory() ) {
405 $oIdList->loadPriceIds( $oCategory->oxcategories__oxpricefrom->value, $oCategory->oxcategories__oxpriceto->value );
407 $sActCat = $oCategory->getId();
408 $oIdList->loadCategoryIDs( $sActCat,
oxSession::getVar(
'session_attrfilter' ) );
410 if ( !isset( $oIdList[$oCurrArticle->getId()] ) ) {
411 $oIdList->loadCategoryIDs( $sActCat, null );
429 $sLink .= ( ( strpos( $sLink,
'?' ) !== false ) ?
'&' :
'?' ) . $sParams;
447 $iPageNr = (int) $iPageNr;
450 if ( !$iPageNr && $oIdList && $oArticle ) {
451 $iNrofCatArticles = (int) $this->
getConfig()->getConfigParam(
'iNrofCatArticles' );
452 $iNrofCatArticles = $iNrofCatArticles?$iNrofCatArticles:1;
454 $sArticleId = $oArticle->oxarticles__oxparentid->value ? $oArticle->oxarticles__oxparentid->value : $oArticle->getId();
455 $iPos = array_search( $sArticleId, $oIdList->arrayKeys() );
456 $iPageNr = floor( $iPos / $iNrofCatArticles );
472 $iPageNr = (int) $iPageNr;
473 return ( ($iPageNr > 0 )?
"pgNr=$iPageNr":
'' );
491 $sOxid = $oArticle->oxarticles__oxparentid->value?$oArticle->oxarticles__oxparentid->value:$oArticle->getId();
492 if ( $oIdList->count() && isset( $oIdList[$sOxid] ) ) {
494 $aIds = $oIdList->arrayKeys();
495 $iPos = array_search( $sOxid, $aIds );
497 if ( array_key_exists( $iPos-1, $aIds ) ) {
498 $oBackProduct =
oxNew(
'oxarticle' );
499 $oBackProduct->modifyCacheKey(
'_locator');
500 $oBackProduct->setNoVariantLoading(
true );
501 if ( $oBackProduct->load( $aIds[$iPos-1] ) ) {
502 $oBackProduct->setLinkType( $oLocatorTarget->getLinkType() );
503 $this->_oBackProduct = $oBackProduct;
507 if ( array_key_exists( $iPos+1, $aIds ) ) {
508 $oNextProduct =
oxNew(
'oxarticle' );
509 $oNextProduct->modifyCacheKey(
'_locator');
510 $oNextProduct->setNoVariantLoading(
true );
511 if ( $oNextProduct->load( $aIds[$iPos+1] ) ) {
512 $oNextProduct->setLinkType( $oLocatorTarget->getLinkType() );
513 $this->_oNextProduct = $oNextProduct;