/**
  * Loads and returns the article for that basket item
  *
  * @param string $sItemKey the key that will be given to oxarticle setItemKey
  *
  * @throws oxArticleException article exception
  *
  * @return oxArticle
  */
 public function getArticle($sItemKey)
 {
     if (!$this->oxuserbasketitems__oxartid->value) {
         //this excpetion may not be caught, anyhow this is a critical exception
         $oEx = oxNew('oxArticleException');
         $oEx->setMessage('EXCEPTION_ARTICLE_NOPRODUCTID');
         throw $oEx;
     }
     if ($this->_oArticle === null) {
         $this->_oArticle = oxNew('oxarticle');
         // performance
         if ($this->_blParentBuyable) {
             $this->_oArticle->setSkipAbPrice(true);
             $this->_oArticle->setNoVariantLoading(true);
         }
         if (!$this->_oArticle->load($this->oxuserbasketitems__oxartid->value)) {
             return false;
         }
         $aSelList = $this->getSelList();
         if (($aSelectlist = $this->_oArticle->getSelectLists()) && is_array($aSelList)) {
             foreach ($aSelList as $iKey => $iSel) {
                 if (isset($aSelectlist[$iKey][$iSel])) {
                     // cloning select list information
                     $aSelectlist[$iKey][$iSel] = clone $aSelectlist[$iKey][$iSel];
                     $aSelectlist[$iKey][$iSel]->selected = 1;
                 }
             }
             $this->_oArticle->setSelectlist($aSelectlist);
         }
         // formatting title if variant
         if ($this->_oArticle->oxarticles__oxparentid->value) {
             $oParent = oxNew('oxarticle');
             if ($oParent->load($this->_oArticle->oxarticles__oxparentid->value)) {
                 if ($this->_oArticle->oxarticles__oxvarselect->value) {
                     $this->_oArticle->oxarticles__oxtitle->value .= ', ' . $this->_oArticle->oxarticles__oxvarselect->value;
                 }
             }
         }
         // generating item key
         $this->_oArticle->setItemKey($sItemKey);
     }
     return $this->_oArticle;
 }
 /**
  * Retrieves the article .Throws an execption if article does not exist,
  * is not buyable or visible.
  *
  * @param bool   $blCheckProduct       checks if product is buyable and visible
  * @param string $sProductId           product id
  * @param bool   $blDisableLazyLoading disable lazy loading
  *
  * @throws oxArticleException, oxNoArticleException exception
  *
  * @return oxarticle
  */
 public function getArticle($blCheckProduct = true, $sProductId = null, $blDisableLazyLoading = false)
 {
     if ($this->_oArticle === null || !$this->_oArticle->isOrderArticle() && $blDisableLazyLoading) {
         $sProductId = $sProductId ? $sProductId : $this->_sProductId;
         if (!$sProductId) {
             //this excpetion may not be caught, anyhow this is a critical exception
             $oEx = oxNew('oxArticleException');
             $oEx->setMessage('EXCEPTION_ARTICLE_NOPRODUCTID');
             throw $oEx;
         }
         $this->_oArticle = oxNew('oxarticle');
         // #M773 Do not use article lazy loading on order save
         if ($blDisableLazyLoading) {
             $this->_oArticle->modifyCacheKey('_allviews');
             $this->_oArticle->disableLazyLoading();
         }
         // performance:
         // - skipping variants loading
         // - skipping 'ab' price info
         // - load parent field
         $this->_oArticle->setNoVariantLoading(true);
         $this->_oArticle->setSkipAbPrice(true);
         $this->_oArticle->setLoadParentData(true);
         if (!$this->_oArticle->load($sProductId)) {
             $oEx = oxNew('oxNoArticleException');
             $oLang = oxLang::getInstance();
             $oEx->setMessage(sprintf($oLang->translateString('EXCEPTION_ARTICLE_ARTICELDOESNOTEXIST', $oLang->getBaseLanguage()), $sProductId));
             $oEx->setArticleNr($sProductId);
             $oEx->setProductId($sProductId);
             throw $oEx;
         }
         // cant put not visible product to basket (M:1286)
         if ($blCheckProduct && !$this->_oArticle->isVisible()) {
             $oEx = oxNew('oxNoArticleException');
             $oLang = oxLang::getInstance();
             $oEx->setMessage(sprintf($oLang->translateString('EXCEPTION_ARTICLE_ARTICELDOESNOTEXIST', $oLang->getBaseLanguage()), $this->_oArticle->oxarticles__oxartnum->value));
             $oEx->setArticleNr($sProductId);
             $oEx->setProductId($sProductId);
             throw $oEx;
         }
         // cant put not buyable product to basket
         if ($blCheckProduct && !$this->_oArticle->isBuyable()) {
             $oEx = oxNew('oxArticleInputException');
             $oEx->setMessage('EXCEPTION_ARTICLE_ARTICELNOTBUYABLE');
             $oEx->setArticleNr($sProductId);
             $oEx->setProductId($sProductId);
             throw $oEx;
         }
     }
     return $this->_oArticle;
 }