227 $this->_oRegularUnitPrice = $oRegularUnitPrice;
249 public function init( $sProductID, $dAmount, $aSel = null, $aPersParam = null, $blBundle = null )
275 $this->
setAmount( $oOrderArticle->oxorderarticles__oxamount->value );
276 $this->
_setSelectList( $oOrderArticle->getOrderArticleSelectList() );
278 $this->
setBundle( $oOrderArticle->isBundle() );
290 $this->_blIsDiscountArticle = $blIsDiscountArticle;
302 $this->_blCheckArticleStock = $blStatus;
327 public function setAmount( $dAmount, $blOverride =
true, $sItemKey = null )
331 $dAmount =
oxRegistry::get(
"oxInputValidator")->validateBasketAmount( $dAmount );
346 $this->_dAmount = $dAmount;
348 $this->_dAmount += $dAmount;
353 $dArtStockAmount = $this->
getSession()->getBasket()->getArtStockInBasket( $oArticle->getId(), $sItemKey );
354 $iOnStock = $oArticle->checkForStock( $this->_dAmount, $dArtStockAmount );
355 if ( $iOnStock !==
true ) {
356 if ( $iOnStock ===
false ) {
361 $this->_dAmount = $iOnStock;
368 $this->_dWeight = $oArticle->oxarticles__oxweight->value *
$this->_dAmount;
370 if ( $iOnStock !==
true ) {
371 $oEx =
oxNew(
'oxOutOfStockException' );
372 $oEx->
setMessage(
'ERROR_MESSAGE_OUTOFSTOCK_OUTOFSTOCK' );
373 $oEx->
setArticleNr( $oArticle->oxarticles__oxartnum->value );
375 $oEx->setRemainingAmount( $this->_dAmount );
376 $oEx->setBasketIndex( $sItemKey );
390 $this->_oUnitPrice = clone $oPrice;
392 $this->_oPrice = clone $oPrice;
393 $this->_oPrice->multiply( $this->
getAmount() );
404 if ( $this->_sIconUrl === null || $this->_blSsl != $this->
getConfig()->isSsl() ) {
405 $this->_sIconUrl = $this->
getArticle()->getIconUrl();
422 public function getArticle( $blCheckProduct =
false, $sProductId = null, $blDisableLazyLoading =
false )
424 if ( $this->_oArticle === null || ( !$this->_oArticle->isOrderArticle() && $blDisableLazyLoading ) ) {
426 if ( !$sProductId ) {
428 $oEx =
oxNew(
'oxArticleException' );
429 $oEx->setMessage(
'EXCEPTION_ARTICLE_NOPRODUCTID' );
433 $this->_oArticle =
oxNew(
'oxarticle' );
435 if ( $blDisableLazyLoading ) {
436 $this->_oArticle->modifyCacheKey(
'_allviews');
437 $this->_oArticle->disableLazyLoading();
444 $this->_oArticle->setNoVariantLoading(
true );
445 $this->_oArticle->setLoadParentData(
true );
446 if ( !$this->_oArticle->load( $sProductId ) ) {
447 $oEx =
oxNew(
'oxNoArticleException' );
449 $oEx->setMessage( sprintf($oLang->translateString(
'ERROR_MESSAGE_ARTICLE_ARTICLE_DOES_NOT_EXIST', $oLang->getBaseLanguage() ), $sProductId) );
450 $oEx->setArticleNr( $sProductId );
451 $oEx->setProductId( $sProductId );
456 if ( $blCheckProduct && !$this->_oArticle->isVisible() ) {
457 $oEx =
oxNew(
'oxNoArticleException' );
459 $oEx->setMessage( sprintf($oLang->translateString(
'ERROR_MESSAGE_ARTICLE_ARTICLE_DOES_NOT_EXIST', $oLang->getBaseLanguage() ), $this->_oArticle->oxarticles__oxartnum->value) );
460 $oEx->setArticleNr( $sProductId );
461 $oEx->setProductId( $sProductId );
466 if ( $blCheckProduct && !$this->_oArticle->isBuyable() ) {
467 $oEx =
oxNew(
'oxArticleInputException' );
468 $oEx->setMessage(
'ERROR_MESSAGE_ARTICLE_ARTICLE_NOT_BUYABLE' );
469 $oEx->setArticleNr( $sProductId );
470 $oEx->setProductId( $sProductId );
485 return $this->
isBundle()?$this->_dAmount:0;
538 $this->_sTitle = $oArticle->oxarticles__oxtitle->value;
540 if ( $oArticle->oxarticles__oxvarselect->value ) {
541 $this->_sTitle = $this->_sTitle.
', ' . $this->
getVarSelect();
559 return $this->
getSession()->processUrl( $this->_sLink );
633 if ( $sName ==
'oProduct' ) {
646 foreach ( get_object_vars( $this ) as $sKey => $sVar ) {
647 if ( $sKey !=
'_oArticle' ) {
674 $oArticle = $this->
getArticle(
true, $sProductId );
677 $this->_sProductId = $sProductId;
679 $this->_sTitle = null;
680 $this->_sVarSelect = null;
684 $this->_sIcon = $oArticle->oxarticles__oxicon->value;
685 $this->_sIconUrl = $oArticle->getIconUrl();
686 $this->_blSsl = $oConfig->isSsl();
689 $this->_sLink =
oxRegistry::get(
"oxUtilsUrl")->cleanUrl( $oArticle->getLink(), array(
'force_sid' ) );
692 $this->_sShopId = $oConfig->getShopId();
693 $this->_sNativeShopId = $oArticle->oxarticles__oxshopid->value;
696 $this->_sDimageDirNoSsl = $oArticle->nossl_dimagedir;
697 $this->_sDimageDirSsl = $oArticle->ssl_dimagedir;
714 $this->_oArticle = $oOrderArticle;
717 $this->_sProductId = $oOrderArticle->getProductId();
720 $this->_sTitle = $oOrderArticle->oxarticles__oxtitle->value;
723 $this->_sShopId = $this->
getConfig()->getShopId();
724 $this->_sNativeShopId = $oOrderArticle->oxarticles__oxshopid->value;
737 $aSelectLists = $this->
getArticle()->getSelectLists();
738 if ( !$aSelList || is_array($aSelList) && count($aSelList) == 0 ) {
739 if ( $iSelCnt = count( $aSelectLists ) ) {
740 $aSelList = array_fill( 0, $iSelCnt,
'0' );
744 $this->_aSelList = $aSelList;
747 if ( count( $this->_aSelList ) && is_array($this->_aSelList) ) {
748 foreach ( $this->_aSelList as $conkey => $iSel ) {
749 $this->_aChosenSelectlist[$conkey] =
new stdClass();
750 $this->_aChosenSelectlist[$conkey]->name = $aSelectLists[$conkey][
'name'];
751 $this->_aChosenSelectlist[$conkey]->value = $aSelectLists[$conkey][$iSel]->name;
775 $this->_aPersistentParameters = $aPersParam;
787 $this->_blBundle = $blBundle;
799 $this->_blSkipDiscounts = $blSkip;
821 $this->_sWrappingId = $sWrapId;
843 $oWrap =
oxNew(
'oxwrapping' );
844 $oWrap->load( $sWrapId );
868 $this->_sWishId = $sWishId;
880 $this->_sWishArticleId = $sArticleId;
948 $this->_sVarSelect = $oArticle->oxarticles__oxvarselect->value ? $oArticle->oxarticles__oxvarselect->value :
'';
974 $this->_iLanguageId = $iLanguageId;
977 if ($iOldLang !== null && $iOldLang != $iLanguageId) {