details.php

Go to the documentation of this file.
00001 <?php
00002 
00009 class Details extends oxUBase
00010 {
00016     protected $_aVariantList = null;
00017 
00023     protected $_sThisTemplate = 'details.tpl';
00024 
00030     protected $_oParentProd = null;
00031 
00037     protected $_blCanRate = null;
00038 
00043     protected $_blShowSorting = true;
00044 
00049     protected $_blEditTags = null;
00050 
00055     protected $_aTags = null;
00056 
00061     protected $_sTagCloud = null;
00062 
00067     protected $_aUserRecommList = null;
00068 
00073     protected $_sLoginFormAnchor = null;
00074 
00079     protected $_oCaptcha = null;
00080 
00085     protected $_aMediaFiles = null;
00086 
00091     protected $_aLastProducts = null;
00092 
00097     protected $_oVendor = null;
00098 
00103     protected $_oManufacturer = null;
00104 
00109     protected $_oCategory = null;
00110 
00115     protected $_aAttributes = null;
00116 
00121     protected $_sParentName = null;
00122 
00127     protected $_sParentUrl = null;
00128 
00133     protected $_aPicGallery = null;
00134 
00139     protected $_aSelectLists = null;
00140 
00145     protected $_aReviews = null;
00146 
00151     protected $_oCrossSelling = null;
00152 
00157     protected $_oSimilarProducts = null;
00158 
00163     protected $_oRecommList = null;
00164 
00169     protected $_oAccessoires = null;
00170 
00175     protected $_aAlsoBoughtArts = null;
00176 
00181     protected $_sSearchTitle = null;
00182 
00188     protected $_blIsInitialized = false;
00189 
00195     protected $_iLinkType = null;
00196 
00202     protected $_blMdView = null;
00203 
00211     protected function _getParentProduct( $sParentId )
00212     {
00213         if ( $sParentId && $this->_oParentProd === null ) {
00214             $this->_oParentProd = false;
00215             if ( ( $oParent = oxNewArticle( $sParentId ) ) ) {
00216                 $this->_processProduct( $oParent );
00217                 $this->_oParentProd = $oParent;
00218             }
00219         }
00220         return $this->_oParentProd;
00221     }
00222 
00229     public function loadVariantInformation()
00230     {
00231         if ( $this->_aVariantList === null ) {
00232             $oProduct = $this->getProduct();
00233 
00234             //loading full list of variants
00235             $this->_aVariantList = $oProduct->getVariants( false );
00236 
00237             //if we are child and do not have any variants then let's load all parent variants as ours
00238             if ( ( $oParent = $this->_getParentProduct( $oProduct->oxarticles__oxparentid->value ) ) && count( $this->_aVariantList ) == 0 ) {
00239                 $myConfig = $this->getConfig();
00240 
00241                 $this->_aVariantList = $oParent->getVariants( false );
00242 
00243                 //in variant list parent may be NOT buyable
00244                 if ( $oParent->blNotBuyableParent ) {
00245                     $oParent->blNotBuyable = true;
00246                 }
00247 
00248                 //lets additionally add parent article if it is sellable
00249                 if ( $myConfig->getConfigParam( 'blVariantParentBuyable' ) ) {
00250                     //#1104S if parent is buyable load selectlists too
00251                     $oParent->aSelectlist = $oParent->getSelectLists();
00252                     $this->_aVariantList = array_merge( array( $oParent ), $this->_aVariantList->getArray() );
00253                 }
00254             }
00255 
00256             // setting link type for variants ..
00257             foreach ( $this->_aVariantList as $oVariant ) {
00258                 $this->_processProduct( $oVariant );
00259             }
00260 
00261         }
00262 
00263         return $this->_aVariantList;
00264     }
00265 
00271     protected function _getAddUrlParams()
00272     {
00273         if ( $this->getListType() == "search" ) {
00274             return $this->getDynUrlParams();
00275         }
00276     }
00277 
00285     protected function _processProduct( $oProduct )
00286     {
00287         $oProduct->setLinkType( $this->getLinkType() );
00288         if ( $sAddParams = $this->_getAddUrlParams() ) {
00289             $oProduct->appendLink( $sAddParams );
00290         }
00291     }
00292 
00298     public function getViewId()
00299     {
00300         if ( isset( $this->_sViewId )) {
00301             return $this->_sViewId;
00302         }
00303 
00304             $sViewId = parent::getViewId().'|'.oxConfig::getParameter( 'anid' ).'|'.count( $this->getVariantList() ).'|';
00305 
00306 
00307         return $this->_sViewId = $sViewId;
00308     }
00309 
00310 
00317     public function init()
00318     {
00319         parent::init();
00320 
00321         $oProduct = $this->getProduct();
00322 
00323         // assign template name
00324         if ( $oProduct->oxarticles__oxtemplate->value ) {
00325             $this->_sThisTemplate = $oProduct->oxarticles__oxtemplate->value;
00326         }
00327 
00328         if ( ( $sTplName = oxConfig::getParameter( 'tpl' ) ) ) {
00329             $this->_sThisTemplate = basename ( $sTplName );
00330         }
00331     }
00332 
00352     public function render()
00353     {
00354         $myConfig = $this->getConfig();
00355 
00356         $oProduct = $this->getProduct();
00357 
00358         //loading amount price list
00359         $oProduct->loadAmountPriceInfo();
00360 
00361         // Passing to view. Left for compatibility reasons for a while. Will be removed in future
00362         $this->_aViewData['product'] = $oProduct;
00363 
00364         $this->_aViewData["aTags"]      = $this->getTags();
00365         $this->_aViewData["blEditTags"] = $this->getEditTags();
00366         startProfile("tagCloud");
00367         $this->_aViewData['tagCloud']   = $this->getTagCloud();
00368         stopProfile("tagCloud");
00369 
00370         $this->_aViewData['loginformanchor'] = $this->getLoginFormAnchor();
00371 
00372         $this->_aViewData['ispricealarm'] = $this->isPriceAlarm();
00373 
00374         $this->_aViewData['customerwho']    = $this->getAlsoBoughtTheseProducts();
00375         $this->_aViewData['accessoirelist'] = $this->getAccessoires();
00376         $this->_aViewData['similarlist']    = $this->getSimilarProducts();
00377         $this->_aViewData['crossselllist']  = $this->getCrossSelling();
00378 
00379         $this->_aViewData['variants'] = $this->getVariantList();
00380 
00381         $this->_aViewData['reviews'] = $this->getReviews();
00382 
00383         $this->_aViewData['selectlist'] = $this->getSelectLists();
00384 
00385         $this->_aViewData["actpicid"]  = $this->getActPictureId();
00386         $this->_aViewData["actpic"]    = $this->getActPicture();
00387         $this->_aViewData['blMorePic'] = $this->morePics();
00388         $this->_aViewData['ArtPics']   = $this->getPictures();
00389         $this->_aViewData['ArtIcons']  = $this->getIcons();
00390         $this->_aViewData['blZoomPic'] = $this->showZoomPics();
00391         $this->_aViewData['aZoomPics'] = $this->getZoomPics();
00392         $this->_aViewData['iZoomPic']  = $this->getActZoomPic();
00393 
00394         $this->_aViewData['parentname']      = $this->getParentName();
00395         $this->_aViewData['parent_url']      = $this->getParentUrl();
00396         $this->_aViewData['draw_parent_url'] = $this->drawParentUrl();
00397 
00398         $this->_aViewData['pgNr'] = $this->getActPage();
00399 
00400         parent::render();
00401 
00402         $this->_aViewData['allartattr'] = $this->getAttributes();
00403 
00404         // #1102C
00405         $this->_aViewData['oCategory'] = $this->getCategory();
00406 
00407         $this->_aViewData['oVendor'] = $this->getVendor();
00408 
00409         $this->_aViewData['oManufacturer'] = $this->getManufacturer();
00410 
00411         $this->_aViewData['aLastProducts'] = $this->getLastProducts();
00412 
00413         // #785A loads and sets locator data
00414         $oLocator = oxNew( 'oxlocator', $this->getListType() );
00415         $oLocator->setLocatorData( $oProduct, $this );
00416 
00417         //media files
00418         $this->_aViewData['aMediaUrls'] = $this->getMediaFiles();
00419 
00420         if ($myConfig->getConfigParam( 'bl_rssRecommLists' ) && $this->getSimilarRecommLists()) {
00421             $oRss = oxNew('oxrssfeed');
00422             $this->addRssFeed($oRss->getRecommListsTitle( $oProduct ), $oRss->getRecommListsUrl( $oProduct ), 'recommlists');
00423         }
00424 
00425 
00426         //antispam
00427         $this->_aViewData['oCaptcha']     = $this->getCaptcha();
00428         $this->_aViewData['sSearchTitle'] = $this->getSearchTitle();
00429         $this->_aViewData['actCatpath']   = $this->getCatTreePath();
00430 
00431         return $this->_sThisTemplate;
00432     }
00433 
00445     protected function _prepareMetaDescription( $sMeta, $iLength = 200, $blDescTag = false )
00446     {
00447         if ( !$sMeta ) {
00448             $oProduct = $this->getProduct();
00449 
00450             $sMeta = $oProduct->getArticleLongDesc()->value;
00451             $sMeta = str_replace( array( '<br>', '<br />', '<br/>' ), "\n", $sMeta );
00452             $sMeta = $oProduct->oxarticles__oxtitle->value.' - '.$sMeta;
00453             $sMeta = strip_tags( $sMeta );
00454         }
00455         return parent::_prepareMetaDescription( $sMeta, $iLength, $blDescTag );
00456     }
00457 
00468     protected function _prepareMetaKeyword( $sKeywords, $blRemoveDuplicatedWords = true )
00469     {
00470         $myConfig = $this->getConfig();
00471 
00472         if ( !$sKeywords ) {
00473             $oProduct = $this->getProduct();
00474             $aKeywords[] = trim( $this->getTitle() );
00475 
00476             if ( $oCatTree = $this->getCategoryTree() ) {
00477                 foreach ( $oCatTree->getPath() as $oCat ) {
00478                     $aKeywords[] = trim( $oCat->oxcategories__oxtitle->value );
00479                 }
00480             }
00481 
00482             $sKeywords = implode( ", ", $aKeywords );
00483 
00484             $sKeywords = parent::_prepareMetaKeyword( $sKeywords, $blRemoveDuplicatedWords );
00485 
00486             //adding searchkeys info
00487             if ( $sSearchKeys = trim( $oProduct->oxarticles__oxsearchkeys->value ) ) {
00488                 $sKeywords .= ", " . parent::_prepareMetaKeyword( $sSearchKeys, false );
00489             }
00490         }
00491 
00492         return $sKeywords;
00493     }
00494 
00500     public function canRate()
00501     {
00502         if ( $this->_blCanRate === null ) {
00503 
00504             $this->_blCanRate = false;
00505             $myConfig = $this->getConfig();
00506 
00507             if ( $myConfig->getConfigParam( 'bl_perfLoadReviews' ) &&
00508                  $oUser = $this->getUser() ) {
00509 
00510                 $oRating = oxNew( 'oxrating' );
00511                 $this->_blCanRate = $oRating->allowRating( $oUser->getId(), 'oxarticle', $this->getProduct()->getId() );
00512             }
00513         }
00514         return $this->_blCanRate;
00515     }
00516 
00522     public function saveReview()
00523     {
00524         if ( $this->canAcceptFormData() &&
00525              ( $oUser = $this->getUser() ) && ( $oProduct = $this->getProduct() ) ) {
00526 
00527             $dRating = oxConfig::getParameter( 'artrating' );
00528             if ( $dRating !== null ) {
00529                 $dRating = (int) $dRating;
00530             }
00531 
00532             //save rating
00533             if ( $dRating !== null && $dRating >= 0 && $dRating <= 5 ) {
00534                 $oRating = oxNew( 'oxrating' );
00535                 if ( $oRating->allowRating( $oUser->getId(), 'oxarticle', $oProduct->getId() ) ) {
00536                     $oRating->oxratings__oxuserid   = new oxField( $oUser->getId() );
00537                     $oRating->oxratings__oxtype     = new oxField( 'oxarticle' );
00538                     $oRating->oxratings__oxobjectid = new oxField( $oProduct->getId() );
00539                     $oRating->oxratings__oxrating   = new oxField( $dRating );
00540                     $oRating->save();
00541                     $oProduct->addToRatingAverage( $dRating );
00542                 }
00543             }
00544 
00545             if ( ( $sReviewText = trim( ( string ) oxConfig::getParameter( 'rvw_txt', true ) ) ) ) {
00546                 $oReview = oxNew( 'oxreview' );
00547                 $oReview->oxreviews__oxobjectid = new oxField( $oProduct->getId() );
00548                 $oReview->oxreviews__oxtype     = new oxField( 'oxarticle' );
00549                 $oReview->oxreviews__oxtext     = new oxField( $sReviewText, oxField::T_RAW );
00550                 $oReview->oxreviews__oxlang     = new oxField( oxLang::getInstance()->getBaseLanguage() );
00551                 $oReview->oxreviews__oxuserid   = new oxField( $oUser->getId() );
00552                 $oReview->oxreviews__oxrating   = new oxField( ( $dRating !== null ) ? $dRating : null );
00553                 $oReview->save();
00554             }
00555         }
00556     }
00557 
00565     public function showLogin()
00566     {
00567         $this->_sThisTemplate = 'account_login.tpl';
00568         if ( $sAnchor = $this->getConfig()->getParameter("anchor") ) {
00569             $this->_sLoginFormAnchor = $sAnchor;
00570         }
00571     }
00572 
00578     public function addToRecomm()
00579     {
00580         if (!$this->getViewConfig()->getShowListmania()) {
00581             return;
00582         }
00583 
00584         $sRecommText = trim( ( string ) oxConfig::getParameter( 'recomm_txt' ) );
00585         $sRecommList = oxConfig::getParameter( 'recomm' );
00586         $sArtId      = oxConfig::getParameter( 'anid' );
00587 
00588         if ( $sArtId ) {
00589             $oRecomm = oxNew( 'oxrecommlist' );
00590             $oRecomm->load( $sRecommList);
00591             $oRecomm->addArticle( $sArtId, $sRecommText );
00592         }
00593     }
00594 
00600     public function addTags()
00601     {
00602         $sTag  = $this->getConfig()->getParameter('newTags', true );
00603         $sHighTag  = $this->getConfig()->getParameter( 'highTags', true );
00604         if ( !$sTag && !$sHighTag) {
00605             return;
00606         }
00607         $sTag .= " ".getStr()->html_entity_decode( $sHighTag );
00608 
00609         $oProduct = $this->getProduct();
00610         $oProduct->addTag( $sTag );
00611 
00612         //refresh
00613         $oTagHandler = oxNew( 'oxTagCloud' );
00614         $this->_sTagCloud = $oTagHandler->getTagCloud( $oProduct->getId() );
00615     }
00616 
00622     public function editTags()
00623     {
00624         $oTagCloud = oxNew("oxTagCloud");
00625         $this->_aTags = $oTagCloud->getTags( $this->getProduct()->getId() );
00626         $this->_blEditTags = true;
00627     }
00628 
00634     protected function _getSeoObjectId()
00635     {
00636         if ( $oProduct = $this->getProduct() ) {
00637             return $oProduct->getId();
00638         }
00639     }
00640 
00646     public function getAttributes()
00647     {
00648         if ( $this->_aAttributes === null ) {
00649             // all attributes this article has
00650             $aArtAttributes = $this->getProduct()->getAttributes();
00651 
00652             //making a new array for backward compatibility
00653             $this->_aAttributes = array();
00654             if ( count( $aArtAttributes ) ) {
00655                 foreach ( $aArtAttributes as $sKey => $oAttribute ) {
00656                     $this->_aAttributes[$sKey] = new stdClass();
00657                     $this->_aAttributes[$sKey]->title = $oAttribute->oxattribute__oxtitle->value;
00658                     $this->_aAttributes[$sKey]->value = $oAttribute->oxattribute__oxvalue->value;
00659                 }
00660             }
00661         }
00662 
00663         return $this->_aAttributes;
00664     }
00665 
00666 
00672     public function getEditTags()
00673     {
00674         return $this->_blEditTags;
00675     }
00676 
00682     public function getTags()
00683     {
00684         return $this->_aTags;
00685     }
00686 
00694     public function getTagCloud()
00695     {
00696         if ( $this->_sTagCloud === null ) {
00697             $this->_sTagCloud = false;
00698             $oTagHandler = oxNew('oxTagCloud');
00699             $this->_sTagCloud = $oTagHandler->getTagCloud($this->getProduct()->getId());
00700         }
00701         return $this->_sTagCloud;
00702     }
00703 
00709     public function getTagCloudManager()
00710     {
00711         $oManager = oxNew( "oxTagCloud" );
00712         $oManager->setExtendedMode( true );
00713         $oManager->setProductId( $this->getProduct()->getId() );
00714         return $oManager;
00715     }
00716 
00722     public function getLoginFormAnchor()
00723     {
00724         return $this->_sLoginFormAnchor;
00725     }
00726 
00732     public function getProduct()
00733     {
00734         $myConfig = $this->getConfig();
00735         $myUtils  = oxUtils::getInstance();
00736 
00737         if ( $this->_oProduct === null ) {
00738 
00739             //this option is only for lists and we must reset value
00740             //as blLoadVariants = false affect "ab price" functionality
00741             $myConfig->setConfigParam( 'blLoadVariants', true );
00742 
00743             $sOxid = oxConfig::getParameter( 'anid' );
00744 
00745             // object is not yet loaded
00746             $this->_oProduct = oxNew( 'oxarticle' );
00747             //$this->_oProduct->setSkipAbPrice( true );
00748 
00749             if ( !$this->_oProduct->load( $sOxid ) ) {
00750                 $myUtils->redirect( $myConfig->getShopHomeURL() );
00751                 $myUtils->showMessageAndExit( '' );
00752             }
00753         }
00754 
00755         // additional checks
00756         if ( !$this->_blIsInitialized ) {
00757             if ( !$this->_oProduct->isVisible() ) {
00758                 $myUtils->redirect( $myConfig->getShopHomeURL() );
00759                 $myUtils->showMessageAndExit( '' );
00760             }
00761 
00762             $this->_processProduct( $this->_oProduct );
00763             $this->_blIsInitialized = true;
00764         }
00765 
00766         return $this->_oProduct;
00767     }
00768 
00774     public function getLinkType()
00775     {
00776         if ( $this->_iLinkType === null ) {
00777             $sListType = oxConfig::getParameter( 'listtype' );
00778             if ( 'vendor' == $sListType ) {
00779                 $this->_iLinkType = OXARTICLE_LINKTYPE_VENDOR;
00780             } elseif ( 'manufacturer' == $sListType ) {
00781                     $this->_iLinkType = OXARTICLE_LINKTYPE_MANUFACTURER;
00782             } elseif ( 'tag' == $sListType ) {
00783                     $this->_iLinkType = OXARTICLE_LINKTYPE_TAG;
00784             } elseif ( 'recommlist' == $sListType ) {
00785                     $this->_iLinkType = OXARTICLE_LINKTYPE_RECOMM;
00786             } else {
00787                 $this->_iLinkType = OXARTICLE_LINKTYPE_CATEGORY;
00788 
00789                 // price category has own type..
00790                 if ( ( $oCat = $this->getActCategory() ) && $oCat->isPriceCategory() ) {
00791                     $this->_iLinkType = OXARTICLE_LINKTYPE_PRICECATEGORY;
00792                 }
00793             }
00794         }
00795 
00796         return $this->_iLinkType;
00797     }
00798 
00804     public function getVariantList()
00805     {
00806         return $this->loadVariantInformation();
00807     }
00808 
00815     public function getVariantListExceptCurrent()
00816     {
00817         $oList = $this->getVariantList();
00818         if (is_object($oList)) {
00819             $oList = clone $oList;
00820         }
00821         $sOxid = $this->getProduct()->getId();
00822         if (isset($oList[$sOxid])) {
00823             unset($oList[$sOxid]);
00824         }
00825         return $oList;
00826     }
00827 
00833     public function getCaptcha()
00834     {
00835         if ( $this->_oCaptcha === null ) {
00836             $this->_oCaptcha = oxNew('oxCaptcha');
00837         }
00838         return $this->_oCaptcha;
00839     }
00840 
00846     public function getMediaFiles()
00847     {
00848         if ( $this->_aMediaFiles === null ) {
00849             $aMediaFiles = $this->getProduct()->getMediaUrls();
00850             $this->_aMediaFiles = count($aMediaFiles) ? $aMediaFiles : false;
00851         }
00852         return $this->_aMediaFiles;
00853     }
00854 
00860     public function getLastProducts()
00861     {
00862         if ( $this->_aLastProducts === null ) {
00863             //last seen products for #768CA
00864             $oProduct = $this->getProduct();
00865             $sArtId = $oProduct->oxarticles__oxparentid->value?$oProduct->oxarticles__oxparentid->value:$oProduct->getId();
00866 
00867             $oHistoryArtList = oxNew( 'oxarticlelist' );
00868             $oHistoryArtList->loadHistoryArticles( $sArtId );
00869             $this->_aLastProducts = $oHistoryArtList;
00870         }
00871         return $this->_aLastProducts;
00872     }
00873 
00879     public function getVendor()
00880     {
00881         if ( $this->_oVendor === null ) {
00882             $this->_oVendor = $this->getProduct()->getVendor( false );
00883         }
00884         return $this->_oVendor;
00885     }
00886 
00892     public function getManufacturer()
00893     {
00894         if ( $this->_oManufacturer === null ) {
00895             $this->_oManufacturer = $this->getProduct()->getManufacturer( false );
00896         }
00897         return $this->_oManufacturer;
00898     }
00899 
00905     public function getCategory()
00906     {
00907         if ( $this->_oCategory === null ) {
00908             $this->_oCategory = $this->getProduct()->getCategory();
00909         }
00910         return $this->_oCategory;
00911     }
00912 
00918     public function drawParentUrl()
00919     {
00920         return $this->getProduct()->isVariant();
00921     }
00922 
00928     public function getParentName()
00929     {
00930         if ( $this->_sParentName === null ) {
00931             $this->_sParentName = false;
00932             if ( ( $oParent = $this->_getParentProduct( $this->getProduct()->oxarticles__oxparentid->value ) ) ) {
00933                 $this->_sParentName = $oParent->oxarticles__oxtitle->value;
00934             }
00935         }
00936         return $this->_sParentName;
00937     }
00938 
00944     public function getParentUrl()
00945     {
00946         if ( $this->_sParentUrl === null ) {
00947             $this->_sParentUrl = false;
00948             if ( ( $oParent = $this->_getParentProduct( $this->getProduct()->oxarticles__oxparentid->value ) ) ) {
00949                 $this->_sParentUrl = $oParent->getLink();
00950             }
00951         }
00952         return $this->_sParentUrl;
00953     }
00954 
00960     public function getPictureGallery()
00961     {
00962         if ( $this->_aPicGallery === null ) {
00963             //get picture gallery
00964             $this->_aPicGallery = $this->getProduct()->getPictureGallery();
00965         }
00966         return $this->_aPicGallery;
00967     }
00968 
00974     public function getActPictureId()
00975     {
00976         $aPicGallery = $this->getPictureGallery();
00977         return $aPicGallery['ActPicID'];
00978     }
00979 
00985     public function getActPicture()
00986     {
00987         $aPicGallery = $this->getPictureGallery();
00988         return $aPicGallery['ActPic'];
00989     }
00990 
00996     public function morePics()
00997     {
00998         $aPicGallery = $this->getPictureGallery();
00999         return $aPicGallery['MorePics'];
01000     }
01001 
01007     public function getPictures()
01008     {
01009         $aPicGallery = $this->getPictureGallery();
01010         return $aPicGallery['Pics'];
01011     }
01012 
01020     public function getArtPic( $sPicNr )
01021     {
01022         $aPicGallery = $this->getPictureGallery();
01023         return $aPicGallery['Pics'][$sPicNr];
01024     }
01025 
01031     public function getIcons()
01032     {
01033         $aPicGallery = $this->getPictureGallery();
01034         return $aPicGallery['Icons'];
01035     }
01036 
01042     public function showZoomPics()
01043     {
01044         $aPicGallery = $this->getPictureGallery();
01045         return $aPicGallery['ZoomPic'];
01046     }
01047 
01053     public function getZoomPics()
01054     {
01055         $aPicGallery = $this->getPictureGallery();
01056         return $aPicGallery['ZoomPics'];
01057     }
01058 
01064     public function getActZoomPic()
01065     {
01066         return 1;
01067     }
01068 
01074     public function getSelectLists()
01075     {
01076         if ( $this->_aSelectLists === null ) {
01077             $this->_aSelectLists = false;
01078             if ( $this->getConfig()->getConfigParam( 'bl_perfLoadSelectLists' ) ) {
01079                 $this->_aSelectLists = $this->getProduct()->getSelectLists();
01080             }
01081         }
01082         return $this->_aSelectLists;
01083     }
01084 
01090     public function getReviews()
01091     {
01092         if ( $this->_aReviews === null ) {
01093             $this->_aReviews = false;
01094             if ( $this->getConfig()->getConfigParam( 'bl_perfLoadReviews' ) ) {
01095                 $this->_aReviews = $this->getProduct()->getReviews();
01096             }
01097         }
01098         return $this->_aReviews;
01099     }
01100 
01106     public function getCrossSelling()
01107     {
01108         if ( $this->_oCrossSelling === null ) {
01109             $this->_oCrossSelling = false;
01110             if ( $oProduct = $this->getProduct() ) {
01111                 $this->_oCrossSelling = $oProduct->getCrossSelling();
01112             }
01113         }
01114         return $this->_oCrossSelling;
01115     }
01116 
01122     public function getSimilarProducts()
01123     {
01124         if ( $this->_oSimilarProducts === null ) {
01125             $this->_oSimilarProducts = false;
01126             if ( $oProduct = $this->getProduct() ) {
01127                 $this->_oSimilarProducts = $oProduct->getSimilarProducts();
01128             }
01129         }
01130         return $this->_oSimilarProducts;
01131     }
01132 
01138     public function getSimilarRecommLists()
01139     {
01140         if (!$this->getViewConfig()->getShowListmania()) {
01141             return false;
01142         }
01143 
01144         if ( $this->_oRecommList === null ) {
01145             $this->_oRecommList = false;
01146             if ( $oProduct = $this->getProduct() ) {
01147                 $oRecommList = oxNew('oxrecommlist');
01148                 $this->_oRecommList = $oRecommList->getRecommListsByIds( array( $oProduct->getId() ) );
01149             }
01150         }
01151         return $this->_oRecommList;
01152     }
01153 
01159     public function getAccessoires()
01160     {
01161         if ( $this->_oAccessoires === null ) {
01162             $this->_oAccessoires = false;
01163             if ( $oProduct = $this->getProduct() ) {
01164                 $this->_oAccessoires = $oProduct->getAccessoires();
01165             }
01166         }
01167         return $this->_oAccessoires;
01168     }
01169 
01177     public function getAlsoBoughtThiesProducts()
01178     {
01179         return $this->getAlsoBoughtTheseProducts();
01180     }
01181 
01187     public function getAlsoBoughtTheseProducts()
01188     {
01189         if ( $this->_aAlsoBoughtArts === null ) {
01190             $this->_aAlsoBoughtArts = false;
01191             if ( $oProduct = $this->getProduct() ) {
01192                 $this->_aAlsoBoughtArts = $oProduct->getCustomerAlsoBoughtThisProducts();
01193             }
01194         }
01195         return $this->_aAlsoBoughtArts;
01196     }
01197 
01203     public function isPriceAlarm()
01204     {
01205         // #419 disabling pricealarm if article has fixed price
01206         $oProduct = $this->getProduct();
01207         if ( isset( $oProduct->oxarticles__oxblfixedprice->value ) && $oProduct->oxarticles__oxblfixedprice->value ) {
01208             return 0;
01209         }
01210         return 1;
01211     }
01212 
01221     protected function _getSubject( $iLang )
01222     {
01223         return $this->getProduct();
01224     }
01225 
01231     public function getSearchTitle()
01232     {
01233         return $this->_sSearchTitle;
01234     }
01235 
01243     public function setSearchTitle( $sTitle )
01244     {
01245         $this->_sSearchTitle = $sTitle;
01246     }
01247 
01255     public function setCatTreePath( $sActCatPath )
01256     {
01257         $this->_sCatTreePath = $sActCatPath;
01258     }
01259 
01266     public function noIndex()
01267     {
01268         $sListType = oxConfig::getParameter( 'listtype' );
01269         if ( $sListType && ( 'vendor' == $sListType || 'manufacturer' == $sListType ) ) {
01270             return $this->_iViewIndexState = VIEW_INDEXSTATE_NOINDEXFOLLOW;
01271         }
01272         return parent::noIndex();
01273     }
01274 
01280     public function getTitle()
01281     {
01282         if ( $oProduct = $this->getProduct() ) {
01283             return $oProduct->oxarticles__oxtitle->value . ( $oProduct->oxarticles__oxvarselect->value ? ' ' . $oProduct->oxarticles__oxvarselect->value : '' );
01284         }
01285     }
01286 
01287 
01293     public function getTag()
01294     {
01295         return oxConfig::getParameter("searchtag", 1);
01296     }
01297 
01303     public function getCanonicalUrl()
01304     {
01305         if ( ( $oProduct = $this->getProduct() ) ) {
01306             $oUtils = oxUtilsUrl::getInstance();
01307             if ( oxUtils::getInstance()->seoIsActive() ) {
01308                 $sUrl = $oUtils->prepareCanonicalUrl( $oProduct->getBaseSeoLink( $oProduct->getLanguage(), true ) );
01309             } else {
01310                 $sUrl = $oUtils->prepareCanonicalUrl( $oProduct->getBaseStdLink( $oProduct->getLanguage() ) );
01311             }
01312             return $sUrl;
01313         }
01314     }
01315 
01321     public function isMdVariantView()
01322     {
01323         if ( $this->_blMdView === null ) {
01324             $this->_blMdView = false;
01325             if ( $this->getConfig()->getConfigParam( 'blUseMultidimensionVariants' ) ) {
01326                 $iMaxMdDepth = $this->getProduct()->getMdVariants()->getMaxDepth();
01327                 $this->_blMdView = ($iMaxMdDepth > 1);
01328             }
01329         }
01330 
01331         return $this->_blMdView;
01332     }
01333 
01339     public function isPersParam()
01340     {
01341         $oProduct = $this->getProduct();
01342         return $oProduct->oxarticles__oxisconfigurable->value;
01343     }
01344 
01350     public function getTagSeparator()
01351     {
01352         $sSepartor = $this->getConfig()->getConfigParam("sTagSeparator");
01353         return $sSepartor;
01354     }
01355 }