source/Application/Model/DeliveryList.php
public function getDeliveryList($oBasket, $oUser = null, $sDelCountry = null, $sDelSet = null)
    {
        // ids of deliveries that does not fit for us to skip double check
        $aSkipDeliveries = [];
        $aFittingDelSets = [];
        $aDelSetList = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\DeliverySetList::class)->getDeliverySetList($oUser, $sDelCountry, $sDelSet);

        // must choose right delivery set to use its delivery list
        foreach ($aDelSetList as $sDeliverySetId => $oDeliverySet) {
            // loading delivery list to check if some of them fits
            $aDeliveries = $this->_getList($oUser, $sDelCountry, $sDeliverySetId);
            $blDelFound = false;

            foreach ($aDeliveries as $sDeliveryId => $oDelivery) {
                // skipping that was checked and didn't fit before
                if (in_array($sDeliveryId, $aSkipDeliveries)) {
                    continue;
                }

                $aSkipDeliveries[] = $sDeliveryId;

                if ($oDelivery->isForBasket($oBasket)) {
                    // delivery fits conditions
                    $this->_aDeliveries[$sDeliveryId] = $aDeliveries[$sDeliveryId];
                    $blDelFound = true;

                    // removing from unfitting list
                    array_pop($aSkipDeliveries);

                    // maybe checked "Stop processing after first match" ?
                    if ($oDelivery->oxdelivery__oxfinalize->value) {
                        break;
                    }
                }
            }

            // found delivery set and deliveries that fits
            if ($blDelFound) {
                if ($this->_blCollectFittingDeliveriesSets) {
                    // collect only deliveries sets that fits deliveries
                    $aFittingDelSets[$sDeliverySetId] = $oDeliverySet;
                } else {
                    // return collected fitting deliveries
                    \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('sShipSet', $sDeliverySetId);

                    return $this->_aDeliveries;
                }
            }
        }

        //return deliveries sets if found
        if ($this->_blCollectFittingDeliveriesSets && count($aFittingDelSets)) {
            //resetting getting delivery sets list instead of deliveries before return
            $this->_blCollectFittingDeliveriesSets = false;

            //reset cache and list
            $this->setUser(null);
            $this->clear();

            return $aFittingDelSets;
        }

        // nothing what fits was found
        return [];
    }
public function getDeliveryList($oBasket, $oUser = null, $sDelCountry = null, $sDelSet = null)
    {
        // ids of deliveries that does not fit for us to skip double check
        $aSkipDeliveries = [];
        $aFittingDelSets = [];
        $aDelSetList = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\DeliverySetList::class)->getDeliverySetList($oUser, $sDelCountry, $sDelSet);

        // must choose right delivery set to use its delivery list
        foreach ($aDelSetList as $sDeliverySetId => $oDeliverySet) {
            // loading delivery list to check if some of them fits
            $aDeliveries = $this->_getList($oUser, $sDelCountry, $sDeliverySetId);
            $blDelFound = false;

            foreach ($aDeliveries as $sDeliveryId => $oDelivery) {
                // skipping that was checked and didn't fit before
                if (in_array($sDeliveryId, $aSkipDeliveries)) {
                    continue;
                }

                $aSkipDeliveries[] = $sDeliveryId;

                if ($oDelivery->isForBasket($oBasket)) {
                    // delivery fits conditions
                    $this->_aDeliveries[$sDeliveryId] = $aDeliveries[$sDeliveryId];
                    $blDelFound = true;

                    // removing from unfitting list
                    array_pop($aSkipDeliveries);

                    // maybe checked "Stop processing after first match" ?
                    if ($oDelivery->oxdelivery__oxfinalize->value) {
                        break;
                    }
                }
            }

            // found delivery set and deliveries that fits
            if ($blDelFound) {
                if ($this->_blCollectFittingDeliveriesSets) {
                    // collect only deliveries sets that fits deliveries
                    $aFittingDelSets[$sDeliverySetId] = $oDeliverySet;
                } else {
                    // return collected fitting deliveries
                    \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('sShipSet', $sDeliverySetId);

                    return $this->_aDeliveries;
                }
            }
        }

        //return deliveries sets if found
        if ($this->_blCollectFittingDeliveriesSets && count($aFittingDelSets)) {
            //resetting getting delivery sets list instead of deliveries before return
            $this->_blCollectFittingDeliveriesSets = false;

            //reset cache and list
            $this->setUser(null);
            $this->clear();

            return $aFittingDelSets;
        }

        // nothing what fits was found
        return [];
    }
public function getDeliveryList ( $ oBasket , $ oUser = null , $ sDelCountry = null , $ sDelSet = null ) { // ids of deliveries that does not fit for us to skip double check $ aSkipDeliveries = [ ] ; $ aFittingDelSets = [ ] ; $ aDelSetList = \ OxidEsales \ Eshop \ Core \ Registry :: get ( \ OxidEsales \ Eshop \ Application \ Model \ DeliverySetList :: class ) -> getDeliverySetList ( $ oUser , $ sDelCountry , $ sDelSet ) ; // must choose right delivery set to use its delivery list foreach ( $ aDelSetList as $ sDeliverySetId => $ oDeliverySet ) { // loading delivery list to check if some of them fits $ aDeliveries = $ this -> _getList ( $ oUser , $ sDelCountry , $ sDeliverySetId ) ; $ blDelFound = false ; foreach ( $ aDeliveries as $ sDeliveryId => $ oDelivery ) { // skipping that was checked and didn't fit before if ( in_array ( $ sDeliveryId , $ aSkipDeliveries ) ) { continue ; } $ aSkipDeliveries [ ] = $ sDeliveryId ; if ( $ oDelivery -> isForBasket ( $ oBasket ) ) { // delivery fits conditions $ this -> _aDeliveries [ $ sDeliveryId ] = $ aDeliveries [ $ sDeliveryId ] ; $ blDelFound = true ; // removing from unfitting list array_pop ( $ aSkipDeliveries ) ; // maybe checked "Stop processing after first match" ? if ( $ oDelivery -> oxdelivery__oxfinalize -> value ) { break ; } } } // found delivery set and deliveries that fits if ( $ blDelFound ) { if ( $ this -> _blCollectFittingDeliveriesSets ) { // collect only deliveries sets that fits deliveries $ aFittingDelSets [ $ sDeliverySetId ] = $ oDeliverySet ; } else { // return collected fitting deliveries \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( 'sShipSet' , $ sDeliverySetId ) ; return $ this -> _aDeliveries ; } } } //return deliveries sets if found if ( $ this -> _blCollectFittingDeliveriesSets && count ( $ aFittingDelSets ) ) { //resetting getting delivery sets list instead of deliveries before return $ this -> _blCollectFittingDeliveriesSets = false ; //reset cache and list $ this -> setUser ( null ) ; $ this -> clear ( ) ; return $ aFittingDelSets ; } // nothing what fits was found return [ ] ; }
Loads and returns list of deliveries.

Process:

- first checks if delivery loading is enabled in config -
$myConfig->bl_perfLoadDelivery is TRUE;
- loads delivery set list by calling this::GetDeliverySetList(...);
- checks if there is any active (eg. chosen delivery set in order
process etc) delivery set defined and if its set - rearranges
delivery set list by storing active set at the beginning in the
list.
- goes through delivery sets and loads its deliveries, checks if any
delivery fits. By checking calculates and stores conditional
amounts:

oDelivery->iItemCnt - items in basket that fits this delivery
oDelivery->iProdCnt - products in basket that fits this delivery
oDelivery->dPrice   - price of products that fits this delivery

- returns a list of deliveries.
NOTICE: for performance reasons deliveries is cached in
$myConfig->aDeliveryList.

@param object                                   $oBasket     basket object
@param \OxidEsales\Eshop\Application\Model\User $oUser       session user
@param string                                   $sDelCountry user country id
@param string                                   $sDelSet     delivery set id

@return array
Loads and returns list of deliveries .