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 
00758             $blContinue = true;
00759             if ( !$this->_oProduct->isVisible() ) {
00760                 $blContinue = false;
00761             } elseif ( $this->_oProduct->oxarticles__oxparentid->value ) {
00762                 $oParent = $this->_getParentProduct( $this->_oProduct->oxarticles__oxparentid->value );
00763                 if ( !$oParent || !$oParent->isVisible() ) {
00764                     $blContinue = false;
00765                 }
00766             }
00767 
00768             if ( !$blContinue ) {
00769                 $myUtils->redirect( $myConfig->getShopHomeURL() );
00770                 $myUtils->showMessageAndExit( '' );
00771             }
00772 
00773             $this->_processProduct( $this->_oProduct );
00774             $this->_blIsInitialized = true;
00775         }
00776 
00777         return $this->_oProduct;
00778     }
00779 
00785     public function getLinkType()
00786     {
00787         if ( $this->_iLinkType === null ) {
00788             $sListType = oxConfig::getParameter( 'listtype' );
00789             if ( 'vendor' == $sListType ) {
00790                 $this->_iLinkType = OXARTICLE_LINKTYPE_VENDOR;
00791             } elseif ( 'manufacturer' == $sListType ) {
00792                     $this->_iLinkType = OXARTICLE_LINKTYPE_MANUFACTURER;
00793             } elseif ( 'tag' == $sListType ) {
00794                     $this->_iLinkType = OXARTICLE_LINKTYPE_TAG;
00795             } elseif ( 'recommlist' == $sListType ) {
00796                     $this->_iLinkType = OXARTICLE_LINKTYPE_RECOMM;
00797             } else {
00798                 $this->_iLinkType = OXARTICLE_LINKTYPE_CATEGORY;
00799 
00800                 // price category has own type..
00801                 if ( ( $oCat = $this->getActCategory() ) && $oCat->isPriceCategory() ) {
00802                     $this->_iLinkType = OXARTICLE_LINKTYPE_PRICECATEGORY;
00803                 }
00804             }
00805         }
00806 
00807         return $this->_iLinkType;
00808     }
00809 
00815     public function getVariantList()
00816     {
00817         return $this->loadVariantInformation();
00818     }
00819 
00826     public function getVariantListExceptCurrent()
00827     {
00828         $oList = $this->getVariantList();
00829         if (is_object($oList)) {
00830             $oList = clone $oList;
00831         }
00832         $sOxid = $this->getProduct()->getId();
00833         if (isset($oList[$sOxid])) {
00834             unset($oList[$sOxid]);
00835         }
00836         return $oList;
00837     }
00838 
00844     public function getCaptcha()
00845     {
00846         if ( $this->_oCaptcha === null ) {
00847             $this->_oCaptcha = oxNew('oxCaptcha');
00848         }
00849         return $this->_oCaptcha;
00850     }
00851 
00857     public function getMediaFiles()
00858     {
00859         if ( $this->_aMediaFiles === null ) {
00860             $aMediaFiles = $this->getProduct()->getMediaUrls();
00861             $this->_aMediaFiles = count($aMediaFiles) ? $aMediaFiles : false;
00862         }
00863         return $this->_aMediaFiles;
00864     }
00865 
00871     public function getLastProducts()
00872     {
00873         if ( $this->_aLastProducts === null ) {
00874             //last seen products for #768CA
00875             $oProduct = $this->getProduct();
00876             $sArtId = $oProduct->oxarticles__oxparentid->value?$oProduct->oxarticles__oxparentid->value:$oProduct->getId();
00877 
00878             $oHistoryArtList = oxNew( 'oxarticlelist' );
00879             $oHistoryArtList->loadHistoryArticles( $sArtId );
00880             $this->_aLastProducts = $oHistoryArtList;
00881         }
00882         return $this->_aLastProducts;
00883     }
00884 
00890     public function getVendor()
00891     {
00892         if ( $this->_oVendor === null ) {
00893             $this->_oVendor = $this->getProduct()->getVendor( false );
00894         }
00895         return $this->_oVendor;
00896     }
00897 
00903     public function getManufacturer()
00904     {
00905         if ( $this->_oManufacturer === null ) {
00906             $this->_oManufacturer = $this->getProduct()->getManufacturer( false );
00907         }
00908         return $this->_oManufacturer;
00909     }
00910 
00916     public function getCategory()
00917     {
00918         if ( $this->_oCategory === null ) {
00919             $this->_oCategory = $this->getProduct()->getCategory();
00920         }
00921         return $this->_oCategory;
00922     }
00923 
00929     public function drawParentUrl()
00930     {
00931         return $this->getProduct()->isVariant();
00932     }
00933 
00939     public function getParentName()
00940     {
00941         if ( $this->_sParentName === null ) {
00942             $this->_sParentName = false;
00943             if ( ( $oParent = $this->_getParentProduct( $this->getProduct()->oxarticles__oxparentid->value ) ) ) {
00944                 $this->_sParentName = $oParent->oxarticles__oxtitle->value;
00945             }
00946         }
00947         return $this->_sParentName;
00948     }
00949 
00955     public function getParentUrl()
00956     {
00957         if ( $this->_sParentUrl === null ) {
00958             $this->_sParentUrl = false;
00959             if ( ( $oParent = $this->_getParentProduct( $this->getProduct()->oxarticles__oxparentid->value ) ) ) {
00960                 $this->_sParentUrl = $oParent->getLink();
00961             }
00962         }
00963         return $this->_sParentUrl;
00964     }
00965 
00971     public function getPictureGallery()
00972     {
00973         if ( $this->_aPicGallery === null ) {
00974             //get picture gallery
00975             $this->_aPicGallery = $this->getProduct()->getPictureGallery();
00976         }
00977         return $this->_aPicGallery;
00978     }
00979 
00985     public function getActPictureId()
00986     {
00987         $aPicGallery = $this->getPictureGallery();
00988         return $aPicGallery['ActPicID'];
00989     }
00990 
00996     public function getActPicture()
00997     {
00998         $aPicGallery = $this->getPictureGallery();
00999         return $aPicGallery['ActPic'];
01000     }
01001 
01007     public function morePics()
01008     {
01009         $aPicGallery = $this->getPictureGallery();
01010         return $aPicGallery['MorePics'];
01011     }
01012 
01018     public function getPictures()
01019     {
01020         $aPicGallery = $this->getPictureGallery();
01021         return $aPicGallery['Pics'];
01022     }
01023 
01031     public function getArtPic( $sPicNr )
01032     {
01033         $aPicGallery = $this->getPictureGallery();
01034         return $aPicGallery['Pics'][$sPicNr];
01035     }
01036 
01042     public function getIcons()
01043     {
01044         $aPicGallery = $this->getPictureGallery();
01045         return $aPicGallery['Icons'];
01046     }
01047 
01053     public function showZoomPics()
01054     {
01055         $aPicGallery = $this->getPictureGallery();
01056         return $aPicGallery['ZoomPic'];
01057     }
01058 
01064     public function getZoomPics()
01065     {
01066         $aPicGallery = $this->getPictureGallery();
01067         return $aPicGallery['ZoomPics'];
01068     }
01069 
01075     public function getActZoomPic()
01076     {
01077         return 1;
01078     }
01079 
01085     public function getSelectLists()
01086     {
01087         if ( $this->_aSelectLists === null ) {
01088             $this->_aSelectLists = false;
01089             if ( $this->getConfig()->getConfigParam( 'bl_perfLoadSelectLists' ) ) {
01090                 $this->_aSelectLists = $this->getProduct()->getSelectLists();
01091             }
01092         }
01093         return $this->_aSelectLists;
01094     }
01095 
01101     public function getReviews()
01102     {
01103         if ( $this->_aReviews === null ) {
01104             $this->_aReviews = false;
01105             if ( $this->getConfig()->getConfigParam( 'bl_perfLoadReviews' ) ) {
01106                 $this->_aReviews = $this->getProduct()->getReviews();
01107             }
01108         }
01109         return $this->_aReviews;
01110     }
01111 
01117     public function getCrossSelling()
01118     {
01119         if ( $this->_oCrossSelling === null ) {
01120             $this->_oCrossSelling = false;
01121             if ( $oProduct = $this->getProduct() ) {
01122                 $this->_oCrossSelling = $oProduct->getCrossSelling();
01123             }
01124         }
01125         return $this->_oCrossSelling;
01126     }
01127 
01133     public function getSimilarProducts()
01134     {
01135         if ( $this->_oSimilarProducts === null ) {
01136             $this->_oSimilarProducts = false;
01137             if ( $oProduct = $this->getProduct() ) {
01138                 $this->_oSimilarProducts = $oProduct->getSimilarProducts();
01139             }
01140         }
01141         return $this->_oSimilarProducts;
01142     }
01143 
01149     public function getSimilarRecommLists()
01150     {
01151         if (!$this->getViewConfig()->getShowListmania()) {
01152             return false;
01153         }
01154 
01155         if ( $this->_oRecommList === null ) {
01156             $this->_oRecommList = false;
01157             if ( $oProduct = $this->getProduct() ) {
01158                 $oRecommList = oxNew('oxrecommlist');
01159                 $this->_oRecommList = $oRecommList->getRecommListsByIds( array( $oProduct->getId() ) );
01160             }
01161         }
01162         return $this->_oRecommList;
01163     }
01164 
01170     public function getAccessoires()
01171     {
01172         if ( $this->_oAccessoires === null ) {
01173             $this->_oAccessoires = false;
01174             if ( $oProduct = $this->getProduct() ) {
01175                 $this->_oAccessoires = $oProduct->getAccessoires();
01176             }
01177         }
01178         return $this->_oAccessoires;
01179     }
01180 
01188     public function getAlsoBoughtThiesProducts()
01189     {
01190         return $this->getAlsoBoughtTheseProducts();
01191     }
01192 
01198     public function getAlsoBoughtTheseProducts()
01199     {
01200         if ( $this->_aAlsoBoughtArts === null ) {
01201             $this->_aAlsoBoughtArts = false;
01202             if ( $oProduct = $this->getProduct() ) {
01203                 $this->_aAlsoBoughtArts = $oProduct->getCustomerAlsoBoughtThisProducts();
01204             }
01205         }
01206         return $this->_aAlsoBoughtArts;
01207     }
01208 
01214     public function isPriceAlarm()
01215     {
01216         // #419 disabling pricealarm if article has fixed price
01217         $oProduct = $this->getProduct();
01218         if ( isset( $oProduct->oxarticles__oxblfixedprice->value ) && $oProduct->oxarticles__oxblfixedprice->value ) {
01219             return 0;
01220         }
01221         return 1;
01222     }
01223 
01232     protected function _getSubject( $iLang )
01233     {
01234         return $this->getProduct();
01235     }
01236 
01242     public function getSearchTitle()
01243     {
01244         return $this->_sSearchTitle;
01245     }
01246 
01254     public function setSearchTitle( $sTitle )
01255     {
01256         $this->_sSearchTitle = $sTitle;
01257     }
01258 
01266     public function setCatTreePath( $sActCatPath )
01267     {
01268         $this->_sCatTreePath = $sActCatPath;
01269     }
01270 
01277     public function noIndex()
01278     {
01279         $sListType = oxConfig::getParameter( 'listtype' );
01280         if ( $sListType && ( 'vendor' == $sListType || 'manufacturer' == $sListType ) ) {
01281             return $this->_iViewIndexState = VIEW_INDEXSTATE_NOINDEXFOLLOW;
01282         }
01283         return parent::noIndex();
01284     }
01285 
01291     public function getTitle()
01292     {
01293         if ( $oProduct = $this->getProduct() ) {
01294             return $oProduct->oxarticles__oxtitle->value . ( $oProduct->oxarticles__oxvarselect->value ? ' ' . $oProduct->oxarticles__oxvarselect->value : '' );
01295         }
01296     }
01297 
01298 
01304     public function getTag()
01305     {
01306         return oxConfig::getParameter("searchtag", 1);
01307     }
01308 
01314     public function getCanonicalUrl()
01315     {
01316         if ( ( $oProduct = $this->getProduct() ) ) {
01317             $oUtils = oxUtilsUrl::getInstance();
01318             if ( oxUtils::getInstance()->seoIsActive() ) {
01319                 $sUrl = $oUtils->prepareCanonicalUrl( $oProduct->getBaseSeoLink( $oProduct->getLanguage(), true ) );
01320             } else {
01321                 $sUrl = $oUtils->prepareCanonicalUrl( $oProduct->getBaseStdLink( $oProduct->getLanguage() ) );
01322             }
01323             return $sUrl;
01324         }
01325     }
01326 
01332     public function isMdVariantView()
01333     {
01334         if ( $this->_blMdView === null ) {
01335             $this->_blMdView = false;
01336             if ( $this->getConfig()->getConfigParam( 'blUseMultidimensionVariants' ) ) {
01337                 $iMaxMdDepth = $this->getProduct()->getMdVariants()->getMaxDepth();
01338                 $this->_blMdView = ($iMaxMdDepth > 1);
01339             }
01340         }
01341 
01342         return $this->_blMdView;
01343     }
01344 
01350     public function isPersParam()
01351     {
01352         $oProduct = $this->getProduct();
01353         return $oProduct->oxarticles__oxisconfigurable->value;
01354     }
01355 
01361     public function getTagSeparator()
01362     {
01363         $sSepartor = $this->getConfig()->getConfigParam("sTagSeparator");
01364         return $sSepartor;
01365     }
01366 }