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 $_oParent = 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 
00197     protected function _getParentProduct( $sParentId )
00198     {
00199         if ( $sParentId && $this->_oParent === null ) {
00200             $this->_oParent = false;
00201             if ( ( $oParent = oxNewArticle( $sParentId ) ) ) {
00202                 $this->_oParent = $oParent;
00203             }
00204         }
00205         return $this->_oParent;
00206     }
00207 
00214     public function loadVariantInformation()
00215     {
00216         if ( $this->_aVariantList === null ) {
00217             $oProduct = $this->getProduct();
00218 
00219             //loading full list of variants
00220             $this->_aVariantList = $oProduct->getVariants( false );
00221 
00222             //if we are child and do not have any variants then please load all parent variants as ours
00223             if ( ( $oParent = $this->_getParentProduct( $oProduct->oxarticles__oxparentid->value ) ) && count( $this->_aVariantList ) == 0 ) {
00224                 $myConfig = $this->getConfig();
00225 
00226                 $this->_aVariantList = $oParent->getVariants( false );
00227 
00228                 //in variant list parent may be NOT buyable
00229                 if ( $oParent->blNotBuyableParent ) {
00230                     $oParent->blNotBuyable = true;
00231                 }
00232 
00233                 //lets additionally add parent article if it is sellable
00234                 if ( $myConfig->getConfigParam( 'blVariantParentBuyable' ) ) {
00235                     //#1104S if parent is buyable load selectlists too
00236                     $oParent->aSelectlist = $oParent->getSelectLists();
00237                     $this->_aVariantList = array_merge( array( $oParent ), $this->_aVariantList->getArray() );
00238                 }
00239 
00240                 //..and skip myself from the list
00241                 if ( isset( $this->_aVariantList[$oProduct->getId()] ) ) {
00242                     unset( $this->_aVariantList[$oProduct->getId()] );
00243                 }
00244             }
00245 
00246             // setting link type for variants ..
00247             foreach ( $this->_aVariantList as $oVariant ) {
00248                 $this->_setLinkType( $oVariant );
00249             }
00250 
00251         }
00252         return $this->_aVariantList;
00253     }
00254 
00260     public function getViewId()
00261     {
00262         if ( isset( $this->_sViewId )) {
00263             return $this->_sViewId;
00264         }
00265 
00266             $sViewId = parent::getViewId().'|'.oxConfig::getParameter( 'anid' ).'|'.count( $this->getVariantList() ).'|';
00267 
00268 
00269         return $this->_sViewId = $sViewId;
00270     }
00271 
00272 
00279     public function init()
00280     {
00281         parent::init();
00282 
00283         $oProduct = $this->getProduct();
00284 
00285         // assign template name
00286         if ( $oProduct->oxarticles__oxtemplate->value ) {
00287             $this->_sThisTemplate = $oProduct->oxarticles__oxtemplate->value;
00288         }
00289 
00290         if ( ( $sTplName = oxConfig::getParameter( 'tpl' ) ) ) {
00291             $this->_sThisTemplate = basename ( $sTplName );
00292         }
00293     }
00294 
00314     public function render()
00315     {
00316         $myConfig = $this->getConfig();
00317 
00318         $oProduct = $this->getProduct();
00319 
00320         //loading amount price list
00321         $oProduct->loadAmountPriceInfo();
00322 
00323         // Passing to view. Left for compatibility reasons for a while. Will be removed in future
00324         $this->_aViewData['product'] = $oProduct;
00325 
00326         $this->_aViewData["aTags"]      = $this->getTags();
00327         $this->_aViewData["blEditTags"] = $this->getEditTags();
00328         startProfile("tagCloud");
00329         $this->_aViewData['tagCloud']   = $this->getTagCloud();
00330         stopProfile("tagCloud");
00331 
00332         $this->_aViewData['loginformanchor'] = $this->getLoginFormAnchor();
00333 
00334         $this->_aViewData['ispricealarm'] = $this->isPriceAlarm();
00335 
00336         $this->_aViewData['customerwho']    = $this->getAlsoBoughtThiesProducts();
00337         $this->_aViewData['accessoirelist'] = $this->getAccessoires();
00338         $this->_aViewData['similarlist']    = $this->getSimilarProducts();
00339         $this->_aViewData['crossselllist']  = $this->getCrossSelling();
00340 
00341         $this->_aViewData['variants'] = $this->getVariantList();
00342 
00343         $this->_aViewData['reviews'] = $this->getReviews();
00344 
00345         $this->_aViewData['selectlist'] = $this->getSelectLists();
00346 
00347         $this->_aViewData["actpicid"]  = $this->getActPictureId();
00348         $this->_aViewData["actpic"]    = $this->getActPicture();
00349         $this->_aViewData['blMorePic'] = $this->morePics();
00350         $this->_aViewData['ArtPics']   = $this->getPictures();
00351         $this->_aViewData['ArtIcons']  = $this->getIcons();
00352         $this->_aViewData['blZoomPic'] = $this->showZoomPics();
00353         $this->_aViewData['aZoomPics'] = $this->getZoomPics();
00354         $this->_aViewData['iZoomPic']  = $this->getActZoomPic();
00355 
00356         $this->_aViewData['parentname']      = $this->getParentName();
00357         $this->_aViewData['parent_url']      = $this->getParentUrl();
00358         $this->_aViewData['draw_parent_url'] = $this->drawParentUrl();
00359 
00360         $this->_aViewData['pgNr'] = $this->getActPage();
00361 
00362         parent::render();
00363 
00364         $this->_aViewData['allartattr'] = $this->getAttributes();
00365 
00366         // #1102C
00367         $this->_aViewData['oCategory'] = $this->getCategory();
00368 
00369         $this->_aViewData['oVendor'] = $this->getVendor();
00370 
00371         $this->_aViewData['oManufacturer'] = $this->getManufacturer();
00372 
00373         $this->_aViewData['aLastProducts'] = $this->getLastProducts();
00374 
00375         // #785A loads and sets locator data
00376         $oLocator = oxNew( 'oxlocator', $this->getListType() );
00377         $oLocator->setLocatorData( $oProduct, $this );
00378 
00379         //media files
00380         $this->_aViewData['aMediaUrls'] = $this->getMediaFiles();
00381 
00382         if (in_array('oxrss_recommlists', $myConfig->getConfigParam( 'aRssSelected' )) && $this->getSimilarRecommLists()) {
00383             $oRss = oxNew('oxrssfeed');
00384             $this->addRssFeed($oRss->getRecommListsTitle( $oProduct ), $oRss->getRecommListsUrl( $oProduct ), 'recommlists');
00385         }
00386 
00387 
00388         //antispam
00389         $this->_aViewData['oCaptcha']     = $this->getCaptcha();
00390         $this->_aViewData['sSearchTitle'] = $this->getSearchTitle();
00391         $this->_aViewData['actCatpath']   = $this->getCatTreePath();
00392 
00393         return $this->_sThisTemplate;
00394     }
00395 
00407     protected function _prepareMetaDescription( $sMeta, $iLength = 200, $blDescTag = false )
00408     {
00409         if ( !$sMeta ) {
00410             $oProduct = $this->getProduct();
00411 
00412             $sMeta = getStr()->strtolower( $oProduct->getArticleLongDesc()->value );
00413             $sMeta = str_replace( array( '<br>', '<br />', '<br/>' ), "\n", $sMeta );
00414             $sMeta = $oProduct->oxarticles__oxtitle->value.' - '.$sMeta;
00415             $sMeta = strip_tags( $sMeta );
00416         }
00417         return parent::_prepareMetaDescription( $sMeta, $iLength, $blDescTag );
00418     }
00419 
00429     protected function _prepareMetaKeyword( $sKeywords )
00430     {
00431         if ( !$sKeywords ) {
00432             $oProduct = $this->getProduct();
00433 
00434             $sKeywords = getStr()->strtolower( $oProduct->getArticleLongDesc()->value );
00435             $sKeywords = str_replace( array( '<br>', '<br />', '<br/>' ), "\n", $sKeywords );
00436             if ( trim( $oProduct->oxarticles__oxsearchkeys->value ) ) {
00437                 $sKeywords = $oProduct->oxarticles__oxsearchkeys->value.' '.$sKeywords;
00438             }
00439             $sKeywords = strip_tags( $sKeywords );
00440         }
00441         return parent::_prepareMetaKeyword( $sKeywords );
00442     }
00443 
00449     public function canRate()
00450     {
00451         if ( $this->_blCanRate === null ) {
00452 
00453             $this->_blCanRate = false;
00454             $myConfig = $this->getConfig();
00455 
00456             if ( $myConfig->getConfigParam( 'bl_perfLoadReviews' ) &&
00457                  $oUser = $this->getUser() ) {
00458 
00459                 $oRating = oxNew( 'oxrating' );
00460                 $this->_blCanRate = $oRating->allowRating( $oUser->getId(), 'oxarticle', $this->getProduct()->getId() );
00461             }
00462         }
00463         return $this->_blCanRate;
00464     }
00465 
00471     public function saveReview()
00472     {
00473         $sReviewText = trim( ( string ) oxConfig::getParameter( 'rvw_txt', true ) );
00474         $dRating     = oxConfig::getParameter( 'artrating' );
00475         if ($dRating < 0 || $dRating > 5) {
00476             $dRating = null;
00477         }
00478 
00479         $sArtId  = oxConfig::getParameter( 'anid' );
00480         $sUserId = oxSession::getVar( 'usr' );
00481 
00482         //save rating
00483         if ( $dRating && $sUserId ) {
00484             $oProduct = $this->getProduct();
00485 
00486             $oRating = oxNew( 'oxrating' );
00487             $blRate = $oRating->allowRating( $sUserId, 'oxarticle', $oProduct->getId());
00488             if ( $blRate) {
00489                 $oRating->oxratings__oxuserid = new oxField($sUserId);
00490                 $oRating->oxratings__oxtype   = new oxField('oxarticle', oxField::T_RAW);
00491                 $oRating->oxratings__oxobjectid = new oxField($sArtId);
00492                 $oRating->oxratings__oxrating = new oxField($dRating);
00493                 $oRating->save();
00494                 $oProduct->addToRatingAverage( $dRating);
00495             } else {
00496                 $dRating = null;
00497             }
00498         }
00499 
00500         if ( $sReviewText && $sUserId ) {
00501             $oReview = oxNew( 'oxreview' );
00502             $oReview->oxreviews__oxobjectid = new oxField($sArtId);
00503             $oReview->oxreviews__oxtype = new oxField('oxarticle', oxField::T_RAW);
00504             $oReview->oxreviews__oxtext = new oxField($sReviewText, oxField::T_RAW);
00505             $oReview->oxreviews__oxlang = new oxField(oxLang::getInstance()->getBaseLanguage());
00506             $oReview->oxreviews__oxuserid = new oxField($sUserId);
00507             $oReview->oxreviews__oxrating = new oxField(( $dRating) ? $dRating : null);
00508             $oReview->save();
00509         }
00510     }
00511 
00517     public function showLogin()
00518     {
00519         $this->_sThisTemplate = 'account_login.tpl';
00520         if ( $sAnchor = $this->getConfig()->getParameter("anchor") ) {
00521             $this->_sLoginFormAnchor = $sAnchor;
00522         }
00523     }
00524 
00530     public function addToRecomm()
00531     {
00532         $sRecommText = trim( ( string ) oxConfig::getParameter( 'recomm_txt' ) );
00533         $sRecommList = oxConfig::getParameter( 'recomm' );
00534         $sArtId      = oxConfig::getParameter( 'anid' );
00535 
00536         if ( $sArtId ) {
00537             $oRecomm = oxNew( 'oxrecommlist' );
00538             $oRecomm->load( $sRecommList);
00539             $oRecomm->addArticle( $sArtId, $sRecommText );
00540         }
00541     }
00542 
00548     public function addTags()
00549     {
00550         $sTag  = $this->getConfig()->getParameter('newTags', true );
00551         $sTag .= " ".getStr()->html_entity_decode( $this->getConfig()->getParameter( 'highTags', true ) );
00552 
00553         $oProduct = $this->getProduct();
00554         $oProduct->addTag( $sTag );
00555 
00556         //refresh
00557         $oTagHandler = oxNew( 'oxTagCloud' );
00558         $this->_sTagCloud = $oTagHandler->getTagCloud( $oProduct->getId() );
00559     }
00560 
00566     public function editTags()
00567     {
00568         $oTagCloud = oxNew("oxTagCloud");
00569         $this->_aTags = $oTagCloud->getTags( $this->getProduct()->getId() );
00570         $this->_blEditTags = true;
00571     }
00572 
00578     protected function _getSeoObjectId()
00579     {
00580         if ( $oProduct = $this->getProduct() ) {
00581             return $oProduct->getId();
00582         }
00583     }
00584 
00590     public function getAttributes()
00591     {
00592         if ( $this->_aAttributes === null ) {
00593             // all attributes this article has
00594             $aArtAttributes = $this->getProduct()->getAttributes();
00595 
00596             //making a new array for backward compatibility
00597             $this->_aAttributes = array();
00598             if ( count( $aArtAttributes ) ) {
00599                 foreach ( $aArtAttributes as $sKey => $oAttribute ) {
00600                     $this->_aAttributes[$sKey] = new stdClass();
00601                     $this->_aAttributes[$sKey]->title = $oAttribute->oxattribute__oxtitle->value;
00602                     $this->_aAttributes[$sKey]->value = $oAttribute->oxattribute__oxvalue->value;
00603                 }
00604             }
00605         }
00606 
00607         return $this->_aAttributes;
00608     }
00609 
00610 
00616     public function getEditTags()
00617     {
00618         return $this->_blEditTags;
00619     }
00620 
00626     public function getTags()
00627     {
00628         return $this->_aTags;
00629     }
00630 
00636     public function getTagCloud()
00637     {
00638         if ( $this->_sTagCloud === null ) {
00639             $this->_sTagCloud = false;
00640             $oTagHandler = oxNew('oxTagCloud');
00641             $this->_sTagCloud = $oTagHandler->getTagCloud($this->getProduct()->getId());
00642         }
00643         return $this->_sTagCloud;
00644     }
00645 
00646 
00652     public function getLoginFormAnchor()
00653     {
00654         return $this->_sLoginFormAnchor;
00655     }
00656 
00662     public function getProduct()
00663     {
00664         $myConfig = $this->getConfig();
00665         $myUtils  = oxUtils::getInstance();
00666 
00667         if ( $this->_oProduct === null ) {
00668 
00669             //this option is only for lists and we must reset value
00670             //as blLoadVariants = false affect "ab price" functionality
00671             $myConfig->setConfigParam( 'blLoadVariants', true );
00672 
00673             $sOxid = oxConfig::getParameter( 'anid' );
00674 
00675             // object is not yet loaded
00676             $this->_oProduct = oxNew( 'oxarticle' );
00677             $this->_oProduct->setSkipAbPrice( true );
00678 
00679             if ( !$this->_oProduct->load( $sOxid ) ) {
00680                 $myUtils->redirect( $myConfig->getShopHomeURL() );
00681                 $myUtils->showMessageAndExit( '' );
00682             }
00683         }
00684 
00685         // additional checks
00686         if ( !$this->_blIsInitialized ) {
00687             if ( !$this->_oProduct->isVisible() ) {
00688                 $myUtils->redirect( $myConfig->getShopHomeURL() );
00689                 $myUtils->showMessageAndExit( '' );
00690             }
00691 
00692             $this->_setLinkType( $this->_oProduct );
00693             $this->_blIsInitialized = true;
00694         }
00695 
00696         return $this->_oProduct;
00697     }
00698 
00707     protected function _setLinkType( $oProduct, $iListType = null )
00708     {
00709         $sListType = isset( $iListType ) ? $iListType : oxConfig::getParameter( 'listtype' );
00710         if ( 'vendor' == $sListType ) {
00711             $iLinkType = OXARTICLE_LINKTYPE_VENDOR;
00712         } elseif ( 'manufacturer' == $sListType ) {
00713             $iLinkType = OXARTICLE_LINKTYPE_MANUFACTURER;
00714         } else {
00715             $iLinkType = OXARTICLE_LINKTYPE_CATEGORY;
00716         }
00717 
00718         $oProduct->setLinkType( $iLinkType );
00719     }
00720 
00726     public function getVariantList()
00727     {
00728         return $this->loadVariantInformation();
00729     }
00730 
00736     public function getCaptcha()
00737     {
00738         if ( $this->_oCaptcha === null ) {
00739             $this->_oCaptcha = oxNew('oxCaptcha');
00740         }
00741         return $this->_oCaptcha;
00742     }
00743 
00749     public function getMediaFiles()
00750     {
00751         if ( $this->_aMediaFiles === null ) {
00752             $aMediaFiles = $this->getProduct()->getMediaUrls();
00753             $this->_aMediaFiles = count($aMediaFiles) ? $aMediaFiles : false;
00754         }
00755         return $this->_aMediaFiles;
00756     }
00757 
00763     public function getLastProducts()
00764     {
00765         if ( $this->_aLastProducts === null ) {
00766             //last seen products for #768CA
00767             $oProduct = $this->getProduct();
00768             $sArtId = $oProduct->oxarticles__oxparentid->value?$oProduct->oxarticles__oxparentid->value:$oProduct->getId();
00769 
00770             $oHistoryArtList = oxNew( 'oxarticlelist' );
00771             $oHistoryArtList->loadHistoryArticles( $sArtId );
00772             $this->_aLastProducts = $oHistoryArtList;
00773         }
00774         return $this->_aLastProducts;
00775     }
00776 
00782     public function getVendor()
00783     {
00784         if ( $this->_oVendor === null ) {
00785             $this->_oVendor = $this->getProduct()->getVendor( false );
00786         }
00787         return $this->_oVendor;
00788     }
00789 
00795     public function getManufacturer()
00796     {
00797         if ( $this->_oManufacturer === null ) {
00798             $this->_oManufacturer = $this->getProduct()->getManufacturer( false );
00799         }
00800         return $this->_oManufacturer;
00801     }
00802 
00808     public function getCategory()
00809     {
00810         if ( $this->_oCategory === null ) {
00811             $this->_oCategory = $this->getProduct()->getCategory();
00812         }
00813         return $this->_oCategory;
00814     }
00815 
00821     public function drawParentUrl()
00822     {
00823         if ( ( $oParent = $this->_getParentProduct( $this->getProduct()->oxarticles__oxparentid->value ) ) ) {
00824             if ( $this->getConfig()->getConfigParam( 'blVariantParentBuyable' ) || count( $this->getVariantList() ) > 0 ) {
00825                 return true;
00826             }
00827         }
00828     }
00829 
00835     public function getParentName()
00836     {
00837         if ( $this->_sParentName === null ) {
00838             $this->_sParentName = false;
00839             if ( ( $oParent = $this->_getParentProduct( $this->getProduct()->oxarticles__oxparentid->value ) ) ) {
00840                 $this->_sParentName = $oParent->oxarticles__oxtitle->value;
00841             }
00842         }
00843         return $this->_sParentName;
00844     }
00845 
00851     public function getParentUrl()
00852     {
00853         if ( $this->_sParentUrl === null ) {
00854             $this->_sParentUrl = false;
00855             if ( ( $oParent = $this->_getParentProduct( $this->getProduct()->oxarticles__oxparentid->value ) ) ) {
00856                 $this->_sParentUrl = $oParent->getLink();
00857             }
00858         }
00859         return $this->_sParentUrl;
00860     }
00861 
00867     public function getPictureGallery()
00868     {
00869         if ( $this->_aPicGallery === null ) {
00870             //get picture gallery
00871             $this->_aPicGallery = $this->getProduct()->getPictureGallery();
00872         }
00873         return $this->_aPicGallery;
00874     }
00875 
00881     public function getActPictureId()
00882     {
00883         $aPicGallery = $this->getPictureGallery();
00884         return $aPicGallery['ActPicID'];
00885     }
00886 
00892     public function getActPicture()
00893     {
00894         $aPicGallery = $this->getPictureGallery();
00895         return $aPicGallery['ActPic'];
00896     }
00897 
00903     public function morePics()
00904     {
00905         $aPicGallery = $this->getPictureGallery();
00906         return $aPicGallery['MorePics'];
00907     }
00908 
00914     public function getPictures()
00915     {
00916         $aPicGallery = $this->getPictureGallery();
00917         return $aPicGallery['Pics'];
00918     }
00919 
00927     public function getArtPic( $sPicNr )
00928     {
00929         $aPicGallery = $this->getPictureGallery();
00930         return $aPicGallery['Pics'][$sPicNr];
00931     }
00932 
00938     public function getIcons()
00939     {
00940         $aPicGallery = $this->getPictureGallery();
00941         return $aPicGallery['Icons'];
00942     }
00943 
00949     public function showZoomPics()
00950     {
00951         $aPicGallery = $this->getPictureGallery();
00952         return $aPicGallery['ZoomPic'];
00953     }
00954 
00960     public function getZoomPics()
00961     {
00962         $aPicGallery = $this->getPictureGallery();
00963         return $aPicGallery['ZoomPics'];
00964     }
00965 
00971     public function getActZoomPic()
00972     {
00973         return 1;
00974     }
00975 
00981     public function getSelectLists()
00982     {
00983         if ( $this->_aSelectLists === null ) {
00984             $this->_aSelectLists = false;
00985             if ( $this->getConfig()->getConfigParam( 'bl_perfLoadSelectLists' ) ) {
00986                 $this->_aSelectLists = $this->getProduct()->getSelectLists();
00987             }
00988         }
00989         return $this->_aSelectLists;
00990     }
00991 
00997     public function getReviews()
00998     {
00999         if ( $this->_aReviews === null ) {
01000             $this->_aReviews = false;
01001             if ( $this->getConfig()->getConfigParam( 'bl_perfLoadReviews' ) ) {
01002                 $this->_aReviews = $this->getProduct()->getReviews();
01003             }
01004         }
01005         return $this->_aReviews;
01006     }
01007 
01013     public function getCrossSelling()
01014     {
01015         if ( $this->_oCrossSelling === null ) {
01016             $this->_oCrossSelling = false;
01017             if ( $oProduct = $this->getProduct() ) {
01018                 $this->_oCrossSelling = $oProduct->getCrossSelling();
01019             }
01020         }
01021         return $this->_oCrossSelling;
01022     }
01023 
01029     public function getSimilarProducts()
01030     {
01031         if ( $this->_oSimilarProducts === null ) {
01032             $this->_oSimilarProducts = false;
01033             if ( $oProduct = $this->getProduct() ) {
01034                 $this->_oSimilarProducts = $oProduct->getSimilarProducts();
01035             }
01036         }
01037         return $this->_oSimilarProducts;
01038     }
01039 
01045     public function getSimilarRecommLists()
01046     {
01047         if ( $this->_oRecommList === null ) {
01048             $this->_oRecommList = false;
01049             if ( $oProduct = $this->getProduct() ) {
01050                 $oRecommList = oxNew('oxrecommlist');
01051                 $this->_oRecommList = $oRecommList->getRecommListsByIds( array( $oProduct->getId() ) );
01052             }
01053         }
01054         return $this->_oRecommList;
01055     }
01056 
01062     public function getAccessoires()
01063     {
01064         if ( $this->_oAccessoires === null ) {
01065             $this->_oAccessoires = false;
01066             if ( $oProduct = $this->getProduct() ) {
01067                 $this->_oAccessoires = $oProduct->getAccessoires();
01068             }
01069         }
01070         return $this->_oAccessoires;
01071     }
01072 
01078     public function getAlsoBoughtThiesProducts()
01079     {
01080         if ( $this->_aAlsoBoughtArts === null ) {
01081             $this->_aAlsoBoughtArts = false;
01082             if ( $oProduct = $this->getProduct() ) {
01083                 $this->_aAlsoBoughtArts = $oProduct->getCustomerAlsoBoughtThisProducts();
01084             }
01085         }
01086         return $this->_aAlsoBoughtArts;
01087     }
01088 
01094     public function isPriceAlarm()
01095     {
01096         // #419 disabling pricealarm if article has fixed price
01097         $oProduct = $this->getProduct();
01098         if ( isset( $oProduct->oxarticles__oxblfixedprice->value ) && $oProduct->oxarticles__oxblfixedprice->value ) {
01099             return 0;
01100         }
01101         return 1;
01102     }
01103 
01110     protected function _getSubject()
01111     {
01112         return $this->getProduct();
01113     }
01114 
01120     public function getSearchTitle()
01121     {
01122         return $this->_sSearchTitle;
01123     }
01124 
01132     public function setSearchTitle( $sTitle )
01133     {
01134         $this->_sSearchTitle = $sTitle;
01135     }
01136 
01144     public function setCatTreePath( $sActCatPath )
01145     {
01146         $this->_sCatTreePath = $sActCatPath;
01147     }
01148 
01155     public function noIndex()
01156     {
01157         $sListType = oxConfig::getParameter( 'listtype' );
01158         if ( $sListType && ( 'vendor' == $sListType || 'manufacturer' == $sListType ) ) {
01159             return $this->_iViewIndexState = VIEW_INDEXSTATE_NOINDEXFOLLOW;
01160         }
01161         return parent::noIndex();
01162     }
01163 
01169     public function getTitle()
01170     {
01171         if ( $oProduct = $this->getProduct() ) {
01172             return $oProduct->oxarticles__oxtitle->value . ( $oProduct->oxarticles__oxvarselect->value ? ' ' . $oProduct->oxarticles__oxvarselect->value : '' );
01173         }
01174     }
01175 }

Generated on Wed May 13 13:25:55 2009 for OXID eShop CE by  doxygen 1.5.5