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 
00195     protected $_iLinkType = null;
00196 
00204     protected function _getParentProduct( $sParentId )
00205     {
00206         if ( $sParentId && $this->_oParent === null ) {
00207             $this->_oParent = false;
00208             if ( ( $oParent = oxNewArticle( $sParentId ) ) ) {
00209                 $this->_processProduct( $oParent );
00210                 $this->_oParent = $oParent;
00211             }
00212         }
00213         return $this->_oParent;
00214     }
00215 
00222     public function loadVariantInformation()
00223     {
00224         if ( $this->_aVariantList === null ) {
00225             $oProduct = $this->getProduct();
00226 
00227             //loading full list of variants
00228             $this->_aVariantList = $oProduct->getVariants( false );
00229 
00230             //if we are child and do not have any variants then please load all parent variants as ours
00231             if ( ( $oParent = $this->_getParentProduct( $oProduct->oxarticles__oxparentid->value ) ) && count( $this->_aVariantList ) == 0 ) {
00232                 $myConfig = $this->getConfig();
00233 
00234                 $this->_aVariantList = $oParent->getVariants( false );
00235 
00236                 //in variant list parent may be NOT buyable
00237                 if ( $oParent->blNotBuyableParent ) {
00238                     $oParent->blNotBuyable = true;
00239                 }
00240 
00241                 //lets additionally add parent article if it is sellable
00242                 if ( $myConfig->getConfigParam( 'blVariantParentBuyable' ) ) {
00243                     //#1104S if parent is buyable load selectlists too
00244                     $oParent->aSelectlist = $oParent->getSelectLists();
00245                     $this->_aVariantList = array_merge( array( $oParent ), $this->_aVariantList->getArray() );
00246                 }
00247 
00248                 //..and skip myself from the list
00249                 if ( isset( $this->_aVariantList[$oProduct->getId()] ) ) {
00250                     unset( $this->_aVariantList[$oProduct->getId()] );
00251                 }
00252             }
00253 
00254             // setting link type for variants ..
00255             foreach ( $this->_aVariantList as $oVariant ) {
00256                 $this->_processProduct( $oVariant );
00257             }
00258 
00259         }
00260         return $this->_aVariantList;
00261     }
00262 
00268     protected function _getAddUrlParams()
00269     {
00270         if ( $this->getListType() == "search" ) {
00271             return $this->getDynUrlParams();
00272         }
00273     }
00274 
00282     protected function _processProduct( $oProduct )
00283     {
00284         $oProduct->setLinkType( $this->getLinkType() );
00285         if ( $sAddParams = $this->_getAddUrlParams() ) {
00286             $oProduct->appendLink( $sAddParams );
00287         }
00288     }
00289 
00295     public function getViewId()
00296     {
00297         if ( isset( $this->_sViewId )) {
00298             return $this->_sViewId;
00299         }
00300 
00301             $sViewId = parent::getViewId().'|'.oxConfig::getParameter( 'anid' ).'|'.count( $this->getVariantList() ).'|';
00302 
00303 
00304         return $this->_sViewId = $sViewId;
00305     }
00306 
00307 
00314     public function init()
00315     {
00316         parent::init();
00317 
00318         $oProduct = $this->getProduct();
00319 
00320         // assign template name
00321         if ( $oProduct->oxarticles__oxtemplate->value ) {
00322             $this->_sThisTemplate = $oProduct->oxarticles__oxtemplate->value;
00323         }
00324 
00325         if ( ( $sTplName = oxConfig::getParameter( 'tpl' ) ) ) {
00326             $this->_sThisTemplate = basename ( $sTplName );
00327         }
00328     }
00329 
00349     public function render()
00350     {
00351         $myConfig = $this->getConfig();
00352 
00353         $oProduct = $this->getProduct();
00354 
00355         //loading amount price list
00356         $oProduct->loadAmountPriceInfo();
00357 
00358         // Passing to view. Left for compatibility reasons for a while. Will be removed in future
00359         $this->_aViewData['product'] = $oProduct;
00360 
00361         $this->_aViewData["aTags"]      = $this->getTags();
00362         $this->_aViewData["blEditTags"] = $this->getEditTags();
00363         startProfile("tagCloud");
00364         $this->_aViewData['tagCloud']   = $this->getTagCloud();
00365         stopProfile("tagCloud");
00366 
00367         $this->_aViewData['loginformanchor'] = $this->getLoginFormAnchor();
00368 
00369         $this->_aViewData['ispricealarm'] = $this->isPriceAlarm();
00370 
00371         $this->_aViewData['customerwho']    = $this->getAlsoBoughtThiesProducts();
00372         $this->_aViewData['accessoirelist'] = $this->getAccessoires();
00373         $this->_aViewData['similarlist']    = $this->getSimilarProducts();
00374         $this->_aViewData['crossselllist']  = $this->getCrossSelling();
00375 
00376         $this->_aViewData['variants'] = $this->getVariantList();
00377 
00378         $this->_aViewData['reviews'] = $this->getReviews();
00379 
00380         $this->_aViewData['selectlist'] = $this->getSelectLists();
00381 
00382         $this->_aViewData["actpicid"]  = $this->getActPictureId();
00383         $this->_aViewData["actpic"]    = $this->getActPicture();
00384         $this->_aViewData['blMorePic'] = $this->morePics();
00385         $this->_aViewData['ArtPics']   = $this->getPictures();
00386         $this->_aViewData['ArtIcons']  = $this->getIcons();
00387         $this->_aViewData['blZoomPic'] = $this->showZoomPics();
00388         $this->_aViewData['aZoomPics'] = $this->getZoomPics();
00389         $this->_aViewData['iZoomPic']  = $this->getActZoomPic();
00390 
00391         $this->_aViewData['parentname']      = $this->getParentName();
00392         $this->_aViewData['parent_url']      = $this->getParentUrl();
00393         $this->_aViewData['draw_parent_url'] = $this->drawParentUrl();
00394 
00395         $this->_aViewData['pgNr'] = $this->getActPage();
00396 
00397         parent::render();
00398 
00399         $this->_aViewData['allartattr'] = $this->getAttributes();
00400 
00401         // #1102C
00402         $this->_aViewData['oCategory'] = $this->getCategory();
00403 
00404         $this->_aViewData['oVendor'] = $this->getVendor();
00405 
00406         $this->_aViewData['oManufacturer'] = $this->getManufacturer();
00407 
00408         $this->_aViewData['aLastProducts'] = $this->getLastProducts();
00409 
00410         // #785A loads and sets locator data
00411         $oLocator = oxNew( 'oxlocator', $this->getListType() );
00412         $oLocator->setLocatorData( $oProduct, $this );
00413 
00414         //media files
00415         $this->_aViewData['aMediaUrls'] = $this->getMediaFiles();
00416 
00417         if (in_array('oxrss_recommlists', $myConfig->getConfigParam( 'aRssSelected' )) && $this->getSimilarRecommLists()) {
00418             $oRss = oxNew('oxrssfeed');
00419             $this->addRssFeed($oRss->getRecommListsTitle( $oProduct ), $oRss->getRecommListsUrl( $oProduct ), 'recommlists');
00420         }
00421 
00422 
00423         //antispam
00424         $this->_aViewData['oCaptcha']     = $this->getCaptcha();
00425         $this->_aViewData['sSearchTitle'] = $this->getSearchTitle();
00426         $this->_aViewData['actCatpath']   = $this->getCatTreePath();
00427 
00428         return $this->_sThisTemplate;
00429     }
00430 
00442     protected function _prepareMetaDescription( $sMeta, $iLength = 200, $blDescTag = false )
00443     {
00444         if ( !$sMeta ) {
00445             $oProduct = $this->getProduct();
00446 
00447             $sMeta = $oProduct->getArticleLongDesc()->value;
00448             $sMeta = str_replace( array( '<br>', '<br />', '<br/>' ), "\n", $sMeta );
00449             $sMeta = $oProduct->oxarticles__oxtitle->value.' - '.$sMeta;
00450             $sMeta = strip_tags( $sMeta );
00451         }
00452         return parent::_prepareMetaDescription( $sMeta, $iLength, $blDescTag );
00453     }
00454 
00465     protected function _prepareMetaKeyword( $sKeywords, $blRemoveDuplicatedWords = true )
00466     {
00467         $myConfig = $this->getConfig();
00468 
00469         if ( !$sKeywords ) {
00470             $oProduct = $this->getProduct();
00471             $aKeywords[] = trim( $this->getTitle() );
00472 
00473             if ( $oCatTree = $this->getCategoryTree() ) {
00474                 foreach ( $oCatTree->getPath() as $oCat ) {
00475                     $aKeywords[] = trim( $oCat->oxcategories__oxtitle->value );
00476                 }
00477             }
00478 
00479             $sKeywords = implode( ", ", $aKeywords );
00480 
00481             $sKeywords = parent::_prepareMetaKeyword( $sKeywords, $blRemoveDuplicatedWords );
00482 
00483             //adding searchkeys info
00484             if ( $sSearchKeys = trim( $oProduct->oxarticles__oxsearchkeys->value ) ) {
00485                 $sKeywords .= ", " . parent::_prepareMetaKeyword( $sSearchKeys, false );
00486             }
00487         }
00488 
00489         return $sKeywords;
00490     }
00491 
00497     public function canRate()
00498     {
00499         if ( $this->_blCanRate === null ) {
00500 
00501             $this->_blCanRate = false;
00502             $myConfig = $this->getConfig();
00503 
00504             if ( $myConfig->getConfigParam( 'bl_perfLoadReviews' ) &&
00505                  $oUser = $this->getUser() ) {
00506 
00507                 $oRating = oxNew( 'oxrating' );
00508                 $this->_blCanRate = $oRating->allowRating( $oUser->getId(), 'oxarticle', $this->getProduct()->getId() );
00509             }
00510         }
00511         return $this->_blCanRate;
00512     }
00513 
00519     public function saveReview()
00520     {
00521         $sReviewText = trim( ( string ) oxConfig::getParameter( 'rvw_txt', true ) );
00522         $dRating     = oxConfig::getParameter( 'artrating' );
00523         if ($dRating < 0 || $dRating > 5) {
00524             $dRating = null;
00525         }
00526 
00527         $sArtId  = oxConfig::getParameter( 'anid' );
00528         $sUserId = oxSession::getVar( 'usr' );
00529 
00530         //save rating
00531         if ( $dRating && $sUserId ) {
00532             $oProduct = $this->getProduct();
00533 
00534             $oRating = oxNew( 'oxrating' );
00535             $blRate = $oRating->allowRating( $sUserId, 'oxarticle', $oProduct->getId());
00536             if ( $blRate) {
00537                 $oRating->oxratings__oxuserid = new oxField($sUserId);
00538                 $oRating->oxratings__oxtype   = new oxField('oxarticle', oxField::T_RAW);
00539                 $oRating->oxratings__oxobjectid = new oxField($sArtId);
00540                 $oRating->oxratings__oxrating = new oxField($dRating);
00541                 $oRating->save();
00542                 $oProduct->addToRatingAverage( $dRating);
00543             } else {
00544                 $dRating = null;
00545             }
00546         }
00547 
00548         if ( $sReviewText && $sUserId ) {
00549             $oReview = oxNew( 'oxreview' );
00550             $oReview->oxreviews__oxobjectid = new oxField($sArtId);
00551             $oReview->oxreviews__oxtype = new oxField('oxarticle', oxField::T_RAW);
00552             $oReview->oxreviews__oxtext = new oxField($sReviewText, oxField::T_RAW);
00553             $oReview->oxreviews__oxlang = new oxField(oxLang::getInstance()->getBaseLanguage());
00554             $oReview->oxreviews__oxuserid = new oxField($sUserId);
00555             $oReview->oxreviews__oxrating = new oxField(( $dRating) ? $dRating : null);
00556             $oReview->save();
00557         }
00558     }
00559 
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         $sRecommText = trim( ( string ) oxConfig::getParameter( 'recomm_txt' ) );
00581         $sRecommList = oxConfig::getParameter( 'recomm' );
00582         $sArtId      = oxConfig::getParameter( 'anid' );
00583 
00584         if ( $sArtId ) {
00585             $oRecomm = oxNew( 'oxrecommlist' );
00586             $oRecomm->load( $sRecommList);
00587             $oRecomm->addArticle( $sArtId, $sRecommText );
00588         }
00589     }
00590 
00596     public function addTags()
00597     {
00598         $sTag  = $this->getConfig()->getParameter('newTags', true );
00599         $sTag .= " ".getStr()->html_entity_decode( $this->getConfig()->getParameter( 'highTags', true ) );
00600 
00601         $oProduct = $this->getProduct();
00602         $oProduct->addTag( $sTag );
00603 
00604         //refresh
00605         $oTagHandler = oxNew( 'oxTagCloud' );
00606         $this->_sTagCloud = $oTagHandler->getTagCloud( $oProduct->getId() );
00607     }
00608 
00614     public function editTags()
00615     {
00616         $oTagCloud = oxNew("oxTagCloud");
00617         $this->_aTags = $oTagCloud->getTags( $this->getProduct()->getId() );
00618         $this->_blEditTags = true;
00619     }
00620 
00626     protected function _getSeoObjectId()
00627     {
00628         if ( $oProduct = $this->getProduct() ) {
00629             return $oProduct->getId();
00630         }
00631     }
00632 
00638     public function getAttributes()
00639     {
00640         if ( $this->_aAttributes === null ) {
00641             // all attributes this article has
00642             $aArtAttributes = $this->getProduct()->getAttributes();
00643 
00644             //making a new array for backward compatibility
00645             $this->_aAttributes = array();
00646             if ( count( $aArtAttributes ) ) {
00647                 foreach ( $aArtAttributes as $sKey => $oAttribute ) {
00648                     $this->_aAttributes[$sKey] = new stdClass();
00649                     $this->_aAttributes[$sKey]->title = $oAttribute->oxattribute__oxtitle->value;
00650                     $this->_aAttributes[$sKey]->value = $oAttribute->oxattribute__oxvalue->value;
00651                 }
00652             }
00653         }
00654 
00655         return $this->_aAttributes;
00656     }
00657 
00658 
00664     public function getEditTags()
00665     {
00666         return $this->_blEditTags;
00667     }
00668 
00674     public function getTags()
00675     {
00676         return $this->_aTags;
00677     }
00678 
00684     public function getTagCloud()
00685     {
00686         if ( $this->_sTagCloud === null ) {
00687             $this->_sTagCloud = false;
00688             $oTagHandler = oxNew('oxTagCloud');
00689             $this->_sTagCloud = $oTagHandler->getTagCloud($this->getProduct()->getId());
00690         }
00691         return $this->_sTagCloud;
00692     }
00693 
00694 
00700     public function getLoginFormAnchor()
00701     {
00702         return $this->_sLoginFormAnchor;
00703     }
00704 
00710     public function getProduct()
00711     {
00712         $myConfig = $this->getConfig();
00713         $myUtils  = oxUtils::getInstance();
00714 
00715         if ( $this->_oProduct === null ) {
00716 
00717             //this option is only for lists and we must reset value
00718             //as blLoadVariants = false affect "ab price" functionality
00719             $myConfig->setConfigParam( 'blLoadVariants', true );
00720 
00721             $sOxid = oxConfig::getParameter( 'anid' );
00722 
00723             // object is not yet loaded
00724             $this->_oProduct = oxNew( 'oxarticle' );
00725             //$this->_oProduct->setSkipAbPrice( true );
00726 
00727             if ( !$this->_oProduct->load( $sOxid ) ) {
00728                 $myUtils->redirect( $myConfig->getShopHomeURL() );
00729                 $myUtils->showMessageAndExit( '' );
00730             }
00731         }
00732 
00733         // additional checks
00734         if ( !$this->_blIsInitialized ) {
00735             if ( !$this->_oProduct->isVisible() ) {
00736                 $myUtils->redirect( $myConfig->getShopHomeURL() );
00737                 $myUtils->showMessageAndExit( '' );
00738             }
00739 
00740             $this->_processProduct( $this->_oProduct );
00741             $this->_blIsInitialized = true;
00742         }
00743 
00744         return $this->_oProduct;
00745     }
00746 
00752     public function getLinkType()
00753     {
00754         if ( $this->_iLinkType === null ) {
00755             $sListType = oxConfig::getParameter( 'listtype' );
00756             if ( 'vendor' == $sListType ) {
00757                 $this->_iLinkType = OXARTICLE_LINKTYPE_VENDOR;
00758             } elseif ( 'manufacturer' == $sListType ) {
00759                 $this->_iLinkType = OXARTICLE_LINKTYPE_MANUFACTURER;
00760             } elseif ( 'tag' == $sListType ) {
00761                 $this->_iLinkType = OXARTICLE_LINKTYPE_TAG;
00762             } else {
00763                 $this->_iLinkType = OXARTICLE_LINKTYPE_CATEGORY;
00764 
00765                 // price category has own type..
00766                 if ( ( $oCat = $this->getCategory() ) && $oCat->isPriceCategory() ) {
00767                     $this->_iLinkType = OXARTICLE_LINKTYPE_PRICECATEGORY;
00768                 }
00769             }
00770         }
00771 
00772         return $this->_iLinkType;
00773     }
00774 
00780     public function getVariantList()
00781     {
00782         return $this->loadVariantInformation();
00783     }
00784 
00790     public function getCaptcha()
00791     {
00792         if ( $this->_oCaptcha === null ) {
00793             $this->_oCaptcha = oxNew('oxCaptcha');
00794         }
00795         return $this->_oCaptcha;
00796     }
00797 
00803     public function getMediaFiles()
00804     {
00805         if ( $this->_aMediaFiles === null ) {
00806             $aMediaFiles = $this->getProduct()->getMediaUrls();
00807             $this->_aMediaFiles = count($aMediaFiles) ? $aMediaFiles : false;
00808         }
00809         return $this->_aMediaFiles;
00810     }
00811 
00817     public function getLastProducts()
00818     {
00819         if ( $this->_aLastProducts === null ) {
00820             //last seen products for #768CA
00821             $oProduct = $this->getProduct();
00822             $sArtId = $oProduct->oxarticles__oxparentid->value?$oProduct->oxarticles__oxparentid->value:$oProduct->getId();
00823 
00824             $oHistoryArtList = oxNew( 'oxarticlelist' );
00825             $oHistoryArtList->loadHistoryArticles( $sArtId );
00826             $this->_aLastProducts = $oHistoryArtList;
00827         }
00828         return $this->_aLastProducts;
00829     }
00830 
00836     public function getVendor()
00837     {
00838         if ( $this->_oVendor === null ) {
00839             $this->_oVendor = $this->getProduct()->getVendor( false );
00840         }
00841         return $this->_oVendor;
00842     }
00843 
00849     public function getManufacturer()
00850     {
00851         if ( $this->_oManufacturer === null ) {
00852             $this->_oManufacturer = $this->getProduct()->getManufacturer( false );
00853         }
00854         return $this->_oManufacturer;
00855     }
00856 
00862     public function getCategory()
00863     {
00864         if ( $this->_oCategory === null ) {
00865             $this->_oCategory = $this->getProduct()->getCategory();
00866         }
00867         return $this->_oCategory;
00868     }
00869 
00875     public function drawParentUrl()
00876     {
00877         return $this->getProduct()->isVariant();
00878     }
00879 
00885     public function getParentName()
00886     {
00887         if ( $this->_sParentName === null ) {
00888             $this->_sParentName = false;
00889             if ( ( $oParent = $this->_getParentProduct( $this->getProduct()->oxarticles__oxparentid->value ) ) ) {
00890                 $this->_sParentName = $oParent->oxarticles__oxtitle->value;
00891             }
00892         }
00893         return $this->_sParentName;
00894     }
00895 
00901     public function getParentUrl()
00902     {
00903         if ( $this->_sParentUrl === null ) {
00904             $this->_sParentUrl = false;
00905             if ( ( $oParent = $this->_getParentProduct( $this->getProduct()->oxarticles__oxparentid->value ) ) ) {
00906                 $this->_sParentUrl = $oParent->getLink();
00907             }
00908         }
00909         return $this->_sParentUrl;
00910     }
00911 
00917     public function getPictureGallery()
00918     {
00919         if ( $this->_aPicGallery === null ) {
00920             //get picture gallery
00921             $this->_aPicGallery = $this->getProduct()->getPictureGallery();
00922         }
00923         return $this->_aPicGallery;
00924     }
00925 
00931     public function getActPictureId()
00932     {
00933         $aPicGallery = $this->getPictureGallery();
00934         return $aPicGallery['ActPicID'];
00935     }
00936 
00942     public function getActPicture()
00943     {
00944         $aPicGallery = $this->getPictureGallery();
00945         return $aPicGallery['ActPic'];
00946     }
00947 
00953     public function morePics()
00954     {
00955         $aPicGallery = $this->getPictureGallery();
00956         return $aPicGallery['MorePics'];
00957     }
00958 
00964     public function getPictures()
00965     {
00966         $aPicGallery = $this->getPictureGallery();
00967         return $aPicGallery['Pics'];
00968     }
00969 
00977     public function getArtPic( $sPicNr )
00978     {
00979         $aPicGallery = $this->getPictureGallery();
00980         return $aPicGallery['Pics'][$sPicNr];
00981     }
00982 
00988     public function getIcons()
00989     {
00990         $aPicGallery = $this->getPictureGallery();
00991         return $aPicGallery['Icons'];
00992     }
00993 
00999     public function showZoomPics()
01000     {
01001         $aPicGallery = $this->getPictureGallery();
01002         return $aPicGallery['ZoomPic'];
01003     }
01004 
01010     public function getZoomPics()
01011     {
01012         $aPicGallery = $this->getPictureGallery();
01013         return $aPicGallery['ZoomPics'];
01014     }
01015 
01021     public function getActZoomPic()
01022     {
01023         return 1;
01024     }
01025 
01031     public function getSelectLists()
01032     {
01033         if ( $this->_aSelectLists === null ) {
01034             $this->_aSelectLists = false;
01035             if ( $this->getConfig()->getConfigParam( 'bl_perfLoadSelectLists' ) ) {
01036                 $this->_aSelectLists = $this->getProduct()->getSelectLists();
01037             }
01038         }
01039         return $this->_aSelectLists;
01040     }
01041 
01047     public function getReviews()
01048     {
01049         if ( $this->_aReviews === null ) {
01050             $this->_aReviews = false;
01051             if ( $this->getConfig()->getConfigParam( 'bl_perfLoadReviews' ) ) {
01052                 $this->_aReviews = $this->getProduct()->getReviews();
01053             }
01054         }
01055         return $this->_aReviews;
01056     }
01057 
01063     public function getCrossSelling()
01064     {
01065         if ( $this->_oCrossSelling === null ) {
01066             $this->_oCrossSelling = false;
01067             if ( $oProduct = $this->getProduct() ) {
01068                 $this->_oCrossSelling = $oProduct->getCrossSelling();
01069             }
01070         }
01071         return $this->_oCrossSelling;
01072     }
01073 
01079     public function getSimilarProducts()
01080     {
01081         if ( $this->_oSimilarProducts === null ) {
01082             $this->_oSimilarProducts = false;
01083             if ( $oProduct = $this->getProduct() ) {
01084                 $this->_oSimilarProducts = $oProduct->getSimilarProducts();
01085             }
01086         }
01087         return $this->_oSimilarProducts;
01088     }
01089 
01095     public function getSimilarRecommLists()
01096     {
01097         if ( $this->_oRecommList === null ) {
01098             $this->_oRecommList = false;
01099             if ( $oProduct = $this->getProduct() ) {
01100                 $oRecommList = oxNew('oxrecommlist');
01101                 $this->_oRecommList = $oRecommList->getRecommListsByIds( array( $oProduct->getId() ) );
01102             }
01103         }
01104         return $this->_oRecommList;
01105     }
01106 
01112     public function getAccessoires()
01113     {
01114         if ( $this->_oAccessoires === null ) {
01115             $this->_oAccessoires = false;
01116             if ( $oProduct = $this->getProduct() ) {
01117                 $this->_oAccessoires = $oProduct->getAccessoires();
01118             }
01119         }
01120         return $this->_oAccessoires;
01121     }
01122 
01128     public function getAlsoBoughtThiesProducts()
01129     {
01130         if ( $this->_aAlsoBoughtArts === null ) {
01131             $this->_aAlsoBoughtArts = false;
01132             if ( $oProduct = $this->getProduct() ) {
01133                 $this->_aAlsoBoughtArts = $oProduct->getCustomerAlsoBoughtThisProducts();
01134             }
01135         }
01136         return $this->_aAlsoBoughtArts;
01137     }
01138 
01144     public function isPriceAlarm()
01145     {
01146         // #419 disabling pricealarm if article has fixed price
01147         $oProduct = $this->getProduct();
01148         if ( isset( $oProduct->oxarticles__oxblfixedprice->value ) && $oProduct->oxarticles__oxblfixedprice->value ) {
01149             return 0;
01150         }
01151         return 1;
01152     }
01153 
01162     protected function _getSubject( $iLang )
01163     {
01164         return $this->getProduct();
01165     }
01166 
01172     public function getSearchTitle()
01173     {
01174         return $this->_sSearchTitle;
01175     }
01176 
01184     public function setSearchTitle( $sTitle )
01185     {
01186         $this->_sSearchTitle = $sTitle;
01187     }
01188 
01196     public function setCatTreePath( $sActCatPath )
01197     {
01198         $this->_sCatTreePath = $sActCatPath;
01199     }
01200 
01207     public function noIndex()
01208     {
01209         $sListType = oxConfig::getParameter( 'listtype' );
01210         if ( $sListType && ( 'vendor' == $sListType || 'manufacturer' == $sListType ) ) {
01211             return $this->_iViewIndexState = VIEW_INDEXSTATE_NOINDEXFOLLOW;
01212         }
01213         return parent::noIndex();
01214     }
01215 
01221     public function getTitle()
01222     {
01223         if ( $oProduct = $this->getProduct() ) {
01224             return $oProduct->oxarticles__oxtitle->value . ( $oProduct->oxarticles__oxvarselect->value ? ' ' . $oProduct->oxarticles__oxvarselect->value : '' );
01225         }
01226     }
01227 
01228 
01234     public function getTag()
01235     {
01236         return oxConfig::getParameter("searchtag", 1);
01237     }
01238 }

Generated on Tue Aug 18 09:21:08 2009 for OXID eShop CE by  doxygen 1.5.5