source/Application/Model/Basket.php
protected function _calcDeliveryCost()
    {
        if ($this->_oDeliveryPrice !== null) {
            return $this->_oDeliveryPrice;
        }
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $oDeliveryPrice = oxNew(\OxidEsales\Eshop\Core\Price::class);

        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blDeliveryVatOnTop')) {
            $oDeliveryPrice->setNettoPriceMode();
        } else {
            $oDeliveryPrice->setBruttoPriceMode();
        }

        // don't calculate if not logged in
        $oUser = $this->getBasketUser();

        if (!$oUser && !$myConfig->getConfigParam('blCalculateDelCostIfNotLoggedIn')) {
            return $oDeliveryPrice;
        }

        $fDelVATPercent = $this->getAdditionalServicesVatPercent();
        $oDeliveryPrice->setVat($fDelVATPercent);

        // list of active delivery costs
        if ($myConfig->getConfigParam('bl_perfLoadDelivery')) {
            $aDeliveryList = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\DeliveryList::class)->getDeliveryList(
                $this,
                $oUser,
                $this->_findDelivCountry(),
                $this->getShippingId()
            );

            if (count($aDeliveryList) > 0) {
                foreach ($aDeliveryList as $oDelivery) {
                    //debug trace
                    if ($myConfig->getConfigParam('iDebug') == 5) {
                        echo("DelCost : " . $oDelivery->oxdelivery__oxtitle->value . "<br>");
                    }
                    $oDeliveryPrice->addPrice($oDelivery->getDeliveryPrice($fDelVATPercent));
                }
            }
        }

        return $oDeliveryPrice;
    }
protected function _calcDeliveryCost()
    {
        if ($this->_oDeliveryPrice !== null) {
            return $this->_oDeliveryPrice;
        }
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $oDeliveryPrice = oxNew(\OxidEsales\Eshop\Core\Price::class);

        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blDeliveryVatOnTop')) {
            $oDeliveryPrice->setNettoPriceMode();
        } else {
            $oDeliveryPrice->setBruttoPriceMode();
        }

        // don't calculate if not logged in
        $oUser = $this->getBasketUser();

        if (!$oUser && !$myConfig->getConfigParam('blCalculateDelCostIfNotLoggedIn')) {
            return $oDeliveryPrice;
        }

        $fDelVATPercent = $this->getAdditionalServicesVatPercent();
        $oDeliveryPrice->setVat($fDelVATPercent);

        // list of active delivery costs
        if ($myConfig->getConfigParam('bl_perfLoadDelivery')) {
            $aDeliveryList = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\DeliveryList::class)->getDeliveryList(
                $this,
                $oUser,
                $this->_findDelivCountry(),
                $this->getShippingId()
            );

            if (count($aDeliveryList) > 0) {
                foreach ($aDeliveryList as $oDelivery) {
                    //debug trace
                    if ($myConfig->getConfigParam('iDebug') == 5) {
                        echo("DelCost : " . $oDelivery->oxdelivery__oxtitle->value . "<br>");
                    }
                    $oDeliveryPrice->addPrice($oDelivery->getDeliveryPrice($fDelVATPercent));
                }
            }
        }

        return $oDeliveryPrice;
    }
protected function _calcDeliveryCost ( ) { if ( $ this -> _oDeliveryPrice !== null ) { return $ this -> _oDeliveryPrice ; } $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ oDeliveryPrice = oxNew ( \ OxidEsales \ Eshop \ Core \ Price :: class ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blDeliveryVatOnTop' ) ) { $ oDeliveryPrice -> setNettoPriceMode ( ) ; } else { $ oDeliveryPrice -> setBruttoPriceMode ( ) ; } // don't calculate if not logged in $ oUser = $ this -> getBasketUser ( ) ; if ( ! $ oUser && ! $ myConfig -> getConfigParam ( 'blCalculateDelCostIfNotLoggedIn' ) ) { return $ oDeliveryPrice ; } $ fDelVATPercent = $ this -> getAdditionalServicesVatPercent ( ) ; $ oDeliveryPrice -> setVat ( $ fDelVATPercent ) ; // list of active delivery costs if ( $ myConfig -> getConfigParam ( 'bl_perfLoadDelivery' ) ) { $ aDeliveryList = \ OxidEsales \ Eshop \ Core \ Registry :: get ( \ OxidEsales \ Eshop \ Application \ Model \ DeliveryList :: class ) -> getDeliveryList ( $ this , $ oUser , $ this -> _findDelivCountry ( ) , $ this -> getShippingId ( ) ) ; if ( count ( $ aDeliveryList ) > 0 ) { foreach ( $ aDeliveryList as $ oDelivery ) { //debug trace if ( $ myConfig -> getConfigParam ( 'iDebug' ) == 5 ) { echo ( "DelCost : " . $ oDelivery -> oxdelivery__oxtitle -> value . "<br>" ) ; } $ oDeliveryPrice -> addPrice ( $ oDelivery -> getDeliveryPrice ( $ fDelVATPercent ) ) ; } } } return $ oDeliveryPrice ; }
Iterates through basket items and calculates its delivery costs

@return \OxidEsales\Eshop\Core\Price
Iterates through basket items and calculates its delivery costs