src/ShopBundle/objects/db/TShopOrderStep/TShopStepShippingCore.class.php
protected function LoadActivePaymentMethod()
    {
        $oBasket = TShopBasket::GetInstance();
        $this->oActivePaymentMethod = &$oBasket->GetActivePaymentMethod();
        if (!is_null($this->oActiveShippingGroup)) {
            $iPaymentId = null;
            $bSelectionValid = true;
            if (array_key_exists('shop_payment_method_id', $this->aRequestData)) {
                $iPaymentId = $this->aRequestData['shop_payment_method_id'];
                // make sure the entry may be selected by the user
                $bSelectionValid = false;
                $oUserSelectablePaymentMethods = $this->oActiveShippingGroup->GetValidPaymentMethodsSelectableByTheUser();
                if (true == $oUserSelectablePaymentMethods->FindItemWithProperty('id', $iPaymentId)) {
                    if (is_null($this->oActivePaymentMethod) || !is_array($this->oActivePaymentMethod->sqlData) || $this->oActivePaymentMethod->id != $iPaymentId) {
                        $this->oActivePaymentMethod = TdbShopPaymentMethod::GetNewInstance();
                        if (!$this->oActivePaymentMethod->Load($iPaymentId)) {
                            $this->oActivePaymentMethod = null;
                        } else {
                            $bSelectionValid = true;
                        }
                    } else {
                        $bSelectionValid = true;
                    }
                }
            }
            if (true == $bSelectionValid) {
                // found one? make sure it is in the active shipping group
                $oList = $oBasket->GetAvailablePaymentMethods();
                if (!is_null($this->oActivePaymentMethod)) {
                    if (!$oList->IsInList($this->oActivePaymentMethod->id)) {
                        $this->oActivePaymentMethod = null;
                    }
                }

                // still nothing? just take the first one from the list
                if (is_null($this->oActivePaymentMethod)) {
                    $oList->GoToStart();
                    if ($oList->Length() > 0) {
                        $this->oActivePaymentMethod = &$oList->Current();
                    }
                }
            }
        } else {
            $this->oActivePaymentMethod = null;
        }
    }
protected function LoadActivePaymentMethod()
    {
        $oBasket = TShopBasket::GetInstance();
        $this->oActivePaymentMethod = &$oBasket->GetActivePaymentMethod();
        if (!is_null($this->oActiveShippingGroup)) {
            $iPaymentId = null;
            $bSelectionValid = true;
            if (array_key_exists('shop_payment_method_id', $this->aRequestData)) {
                $iPaymentId = $this->aRequestData['shop_payment_method_id'];
                // make sure the entry may be selected by the user
                $bSelectionValid = false;
                $oUserSelectablePaymentMethods = $this->oActiveShippingGroup->GetValidPaymentMethodsSelectableByTheUser();
                if (true == $oUserSelectablePaymentMethods->FindItemWithProperty('id', $iPaymentId)) {
                    if (is_null($this->oActivePaymentMethod) || !is_array($this->oActivePaymentMethod->sqlData) || $this->oActivePaymentMethod->id != $iPaymentId) {
                        $this->oActivePaymentMethod = TdbShopPaymentMethod::GetNewInstance();
                        if (!$this->oActivePaymentMethod->Load($iPaymentId)) {
                            $this->oActivePaymentMethod = null;
                        } else {
                            $bSelectionValid = true;
                        }
                    } else {
                        $bSelectionValid = true;
                    }
                }
            }
            if (true == $bSelectionValid) {
                // found one? make sure it is in the active shipping group
                $oList = $oBasket->GetAvailablePaymentMethods();
                if (!is_null($this->oActivePaymentMethod)) {
                    if (!$oList->IsInList($this->oActivePaymentMethod->id)) {
                        $this->oActivePaymentMethod = null;
                    }
                }

                // still nothing? just take the first one from the list
                if (is_null($this->oActivePaymentMethod)) {
                    $oList->GoToStart();
                    if ($oList->Length() > 0) {
                        $this->oActivePaymentMethod = &$oList->Current();
                    }
                }
            }
        } else {
            $this->oActivePaymentMethod = null;
        }
    }
protected function LoadActivePaymentMethod ( ) { $ oBasket = TShopBasket :: GetInstance ( ) ; $ this -> oActivePaymentMethod = & $ oBasket -> GetActivePaymentMethod ( ) ; if ( ! is_null ( $ this -> oActiveShippingGroup ) ) { $ iPaymentId = null ; $ bSelectionValid = true ; if ( array_key_exists ( 'shop_payment_method_id' , $ this -> aRequestData ) ) { $ iPaymentId = $ this -> aRequestData [ 'shop_payment_method_id' ] ; // make sure the entry may be selected by the user $ bSelectionValid = false ; $ oUserSelectablePaymentMethods = $ this -> oActiveShippingGroup -> GetValidPaymentMethodsSelectableByTheUser ( ) ; if ( true == $ oUserSelectablePaymentMethods -> FindItemWithProperty ( 'id' , $ iPaymentId ) ) { if ( is_null ( $ this -> oActivePaymentMethod ) || ! is_array ( $ this -> oActivePaymentMethod -> sqlData ) || $ this -> oActivePaymentMethod -> id != $ iPaymentId ) { $ this -> oActivePaymentMethod = TdbShopPaymentMethod :: GetNewInstance ( ) ; if ( ! $ this -> oActivePaymentMethod -> Load ( $ iPaymentId ) ) { $ this -> oActivePaymentMethod = null ; } else { $ bSelectionValid = true ; } } else { $ bSelectionValid = true ; } } } if ( true == $ bSelectionValid ) { // found one? make sure it is in the active shipping group $ oList = $ oBasket -> GetAvailablePaymentMethods ( ) ; if ( ! is_null ( $ this -> oActivePaymentMethod ) ) { if ( ! $ oList -> IsInList ( $ this -> oActivePaymentMethod -> id ) ) { $ this -> oActivePaymentMethod = null ; } } // still nothing? just take the first one from the list if ( is_null ( $ this -> oActivePaymentMethod ) ) { $ oList -> GoToStart ( ) ; if ( $ oList -> Length ( ) > 0 ) { $ this -> oActivePaymentMethod = & $ oList -> Current ( ) ; } } } } else { $ this -> oActivePaymentMethod = null ; } }
loads the active payment method.
loads the active payment method .