public function SetActiveShippingGroup($oShippingGroup)
    {
        $bGroupAssigned = false;
        if (!is_null($oShippingGroup)) {
            $oAvailableShippingGroups = $this->GetAvailableShippingGroups();
            if (!is_null($oAvailableShippingGroups) && $oAvailableShippingGroups->IsInList($oShippingGroup->id)) {
                $bGroupAssigned = true;
                $this->oActiveShippingGroup = $oShippingGroup;

                // if a payment method is selected, then we need to make sure it is available for the selected shipping group.
                // since the SetActivePaymentmethod performs the check we call it.
                if (!is_null($this->GetActivePaymentMethod())) {
                    $this->SetActivePaymentMethod($this->GetActivePaymentMethod());
                }
            }
        } else {
            $this->oActiveShippingGroup = null;
            $this->SetActivePaymentMethod(null);
        }

        return $bGroupAssigned;
    }