src/ShopBundle/objects/db/TShopShippingGroup.class.php
public function GetValidShippingTypesForBasketArticleListAndCountry($oBasketArticleList, $sDataCountryId)
    {
        $oValidShippingTypes = new TIterator();
        /** @var $oValidShippingTypes TIterator* */
        $oShippingTypes = $this->GetFieldShopShippingTypeList('position');
        while ($oShippingType = $oShippingTypes->Next()) {
            $bIsValid = $oShippingType->IsActive();
            $bIsValid = $bIsValid && $oShippingType->isValidForCurrentPortal();
            $bIsValid = $bIsValid && $oShippingType->IsValidForCurrentUser(false);
            $bIsValid = $bIsValid && $oShippingType->IsValidForCountry($sDataCountryId);
            if ($bIsValid) {
                $oAffectedArticles = $oBasketArticleList->GetArticlesAffectedByShippingType($oShippingType);
                $bIsValid = ($oAffectedArticles->Length() > 0);
            }
            if ($bIsValid) {
                $oValidShippingTypes->AddItem($oShippingType);
            }
        }

        return $oValidShippingTypes;
    }
public function GetValidShippingTypesForBasketArticleListAndCountry($oBasketArticleList, $sDataCountryId)
    {
        $oValidShippingTypes = new TIterator();
        /** @var $oValidShippingTypes TIterator* */
        $oShippingTypes = $this->GetFieldShopShippingTypeList('position');
        while ($oShippingType = $oShippingTypes->Next()) {
            $bIsValid = $oShippingType->IsActive();
            $bIsValid = $bIsValid && $oShippingType->isValidForCurrentPortal();
            $bIsValid = $bIsValid && $oShippingType->IsValidForCurrentUser(false);
            $bIsValid = $bIsValid && $oShippingType->IsValidForCountry($sDataCountryId);
            if ($bIsValid) {
                $oAffectedArticles = $oBasketArticleList->GetArticlesAffectedByShippingType($oShippingType);
                $bIsValid = ($oAffectedArticles->Length() > 0);
            }
            if ($bIsValid) {
                $oValidShippingTypes->AddItem($oShippingType);
            }
        }

        return $oValidShippingTypes;
    }
public function GetValidShippingTypesForBasketArticleListAndCountry ( $ oBasketArticleList , $ sDataCountryId ) { $ oValidShippingTypes = new TIterator ( ) ; /** @var $oValidShippingTypes TIterator* */ $ oShippingTypes = $ this -> GetFieldShopShippingTypeList ( 'position' ) ; while ( $ oShippingType = $ oShippingTypes -> Next ( ) ) { $ bIsValid = $ oShippingType -> IsActive ( ) ; $ bIsValid = $ bIsValid && $ oShippingType -> isValidForCurrentPortal ( ) ; $ bIsValid = $ bIsValid && $ oShippingType -> IsValidForCurrentUser ( false ) ; $ bIsValid = $ bIsValid && $ oShippingType -> IsValidForCountry ( $ sDataCountryId ) ; if ( $ bIsValid ) { $ oAffectedArticles = $ oBasketArticleList -> GetArticlesAffectedByShippingType ( $ oShippingType ) ; $ bIsValid = ( $ oAffectedArticles -> Length ( ) > 0 ) ; } if ( $ bIsValid ) { $ oValidShippingTypes -> AddItem ( $ oShippingType ) ; } } return $ oValidShippingTypes ; }
Get a list of shipping types based on a basket article list and the desired shipping country id.

@param TShopBasketArticleList $oBasketArticleList
@param string                 $sDataCountryId

@return TIterator
Get a list of shipping types based on a basket article list and the desired shipping country id .