src/ShopBundle/objects/db/TShopShippingType.class.php
public function GetPrice()
    {
        if (is_null($this->dPrice)) {
            $this->dPrice = 0;

            // price based on basket
            if ($this->fieldValueBasedOnEntireBasket) {
                $oBasket = TShopBasket::GetInstance();
                $iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation = 0;
                $iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation = 0;
                $oItemList = $oBasket->GetBasketContents();
                $oItemList->GoToStart();
                while ($oItem = &$oItemList->Next()) {
                    if ($oItem->fieldExcludeFromShippingCostCalculation) {
                        $iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation += $oItem->dAmount;
                        $iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation += $oItem->dPriceTotalAfterDiscount;
                    }
                }
                $oItemList->GoToStart();

                if ('absolut' == $this->fieldValueType) {
                    $this->dPrice = $this->fieldValue;
                    if ($this->fieldAddValueForEachArticle ||
                        ($iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation > 0 &&
                         $oBasket->dTotalNumberOfArticles == $iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation
                        )
                    ) {
                        $this->dPrice = ($oBasket->dTotalNumberOfArticles - $iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation) * $this->dPrice;
                    }
                } else {
                    $this->dPrice = round($this->ApplyPriceModifiers(($oBasket->dCostArticlesTotalAfterDiscounts - $iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation) * ($this->fieldValue / 100)), 2);
                }
            } else {
                // price based on current list
                /** @var $oArticleList TShopBasketArticleList */
                $oArticleList = &$this->GetAffectedBasketArticles();
                if (!is_null($oArticleList)) {
                    $iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation = 0;
                    $iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation = 0;
                    $oArticleList->GoToStart();
                    while ($oArticle = &$oArticleList->Next()) {
                        if ($oArticle->fieldExcludeFromShippingCostCalculation) {
                            $iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation += $oArticle->dAmount;
                            $iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation += $oArticle->dPriceTotalAfterDiscount;
                        }
                    }
                    $oArticleList->GoToStart();

                    if ('absolut' == $this->fieldValueType) {
                        $this->dPrice = $this->fieldValue;
                        if ($this->fieldAddValueForEachArticle ||
                            ($iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation > 0 &&
                             $oArticleList->dNumberOfItems == $iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation
                            )
                        ) {
                            $this->dPrice = ($oArticleList->dNumberOfItems - $iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation) * $this->dPrice;
                        }
                    } else {
                        $this->dPrice = round($this->ApplyPriceModifiers(($oArticleList->dProductPrice - $iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation) * ($this->fieldValue / 100)), 2);
                    }
                }
            }
        }

        return $this->dPrice;
    }
public function GetPrice()
    {
        if (is_null($this->dPrice)) {
            $this->dPrice = 0;

            // price based on basket
            if ($this->fieldValueBasedOnEntireBasket) {
                $oBasket = TShopBasket::GetInstance();
                $iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation = 0;
                $iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation = 0;
                $oItemList = $oBasket->GetBasketContents();
                $oItemList->GoToStart();
                while ($oItem = &$oItemList->Next()) {
                    if ($oItem->fieldExcludeFromShippingCostCalculation) {
                        $iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation += $oItem->dAmount;
                        $iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation += $oItem->dPriceTotalAfterDiscount;
                    }
                }
                $oItemList->GoToStart();

                if ('absolut' == $this->fieldValueType) {
                    $this->dPrice = $this->fieldValue;
                    if ($this->fieldAddValueForEachArticle ||
                        ($iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation > 0 &&
                         $oBasket->dTotalNumberOfArticles == $iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation
                        )
                    ) {
                        $this->dPrice = ($oBasket->dTotalNumberOfArticles - $iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation) * $this->dPrice;
                    }
                } else {
                    $this->dPrice = round($this->ApplyPriceModifiers(($oBasket->dCostArticlesTotalAfterDiscounts - $iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation) * ($this->fieldValue / 100)), 2);
                }
            } else {
                // price based on current list
                /** @var $oArticleList TShopBasketArticleList */
                $oArticleList = &$this->GetAffectedBasketArticles();
                if (!is_null($oArticleList)) {
                    $iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation = 0;
                    $iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation = 0;
                    $oArticleList->GoToStart();
                    while ($oArticle = &$oArticleList->Next()) {
                        if ($oArticle->fieldExcludeFromShippingCostCalculation) {
                            $iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation += $oArticle->dAmount;
                            $iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation += $oArticle->dPriceTotalAfterDiscount;
                        }
                    }
                    $oArticleList->GoToStart();

                    if ('absolut' == $this->fieldValueType) {
                        $this->dPrice = $this->fieldValue;
                        if ($this->fieldAddValueForEachArticle ||
                            ($iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation > 0 &&
                             $oArticleList->dNumberOfItems == $iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation
                            )
                        ) {
                            $this->dPrice = ($oArticleList->dNumberOfItems - $iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation) * $this->dPrice;
                        }
                    } else {
                        $this->dPrice = round($this->ApplyPriceModifiers(($oArticleList->dProductPrice - $iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation) * ($this->fieldValue / 100)), 2);
                    }
                }
            }
        }

        return $this->dPrice;
    }
public function GetPrice ( ) { if ( is_null ( $ this -> dPrice ) ) { $ this -> dPrice = 0 ; // price based on basket if ( $ this -> fieldValueBasedOnEntireBasket ) { $ oBasket = TShopBasket :: GetInstance ( ) ; $ iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation = 0 ; $ iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation = 0 ; $ oItemList = $ oBasket -> GetBasketContents ( ) ; $ oItemList -> GoToStart ( ) ; while ( $ oItem = & $ oItemList -> Next ( ) ) { if ( $ oItem -> fieldExcludeFromShippingCostCalculation ) { $ iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation += $ oItem -> dAmount ; $ iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation += $ oItem -> dPriceTotalAfterDiscount ; } } $ oItemList -> GoToStart ( ) ; if ( 'absolut' == $ this -> fieldValueType ) { $ this -> dPrice = $ this -> fieldValue ; if ( $ this -> fieldAddValueForEachArticle || ( $ iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation > 0 && $ oBasket -> dTotalNumberOfArticles == $ iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation ) ) { $ this -> dPrice = ( $ oBasket -> dTotalNumberOfArticles - $ iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation ) * $ this -> dPrice ; } } else { $ this -> dPrice = round ( $ this -> ApplyPriceModifiers ( ( $ oBasket -> dCostArticlesTotalAfterDiscounts - $ iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation ) * ( $ this -> fieldValue / 100 ) ) , 2 ) ; } } else { // price based on current list /** @var $oArticleList TShopBasketArticleList */ $ oArticleList = & $ this -> GetAffectedBasketArticles ( ) ; if ( ! is_null ( $ oArticleList ) ) { $ iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation = 0 ; $ iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation = 0 ; $ oArticleList -> GoToStart ( ) ; while ( $ oArticle = & $ oArticleList -> Next ( ) ) { if ( $ oArticle -> fieldExcludeFromShippingCostCalculation ) { $ iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation += $ oArticle -> dAmount ; $ iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation += $ oArticle -> dPriceTotalAfterDiscount ; } } $ oArticleList -> GoToStart ( ) ; if ( 'absolut' == $ this -> fieldValueType ) { $ this -> dPrice = $ this -> fieldValue ; if ( $ this -> fieldAddValueForEachArticle || ( $ iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation > 0 && $ oArticleList -> dNumberOfItems == $ iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation ) ) { $ this -> dPrice = ( $ oArticleList -> dNumberOfItems - $ iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation ) * $ this -> dPrice ; } } else { $ this -> dPrice = round ( $ this -> ApplyPriceModifiers ( ( $ oArticleList -> dProductPrice - $ iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation ) * ( $ this -> fieldValue / 100 ) ) , 2 ) ; } } } } return $ this -> dPrice ; }
return shipping type cost.

@return float
return shipping type cost .