public function aroundGetNotLoggedInGroup(
        \Magento\Customer\Model\GroupManagement $subject,
        \Closure $proceed
    )
    {
        /* call parent to process other around-plugins */
        $result = $proceed();
        /* check referral code in registry */
        $code = $this->hlpReferral->getReferralCode();
        if ($code) {
            /* and return referral group if code exists */
            $groupId = $this->hlpConfig->getReferralsGroupReferrals();
            $result = $this->daoCustGroup->getById($groupId);
        }
        return $result;
    }
public function aroundGetNotLoggedInGroup(
        \Magento\Customer\Model\GroupManagement $subject,
        \Closure $proceed
    )
    {
        /* call parent to process other around-plugins */
        $result = $proceed();
        /* check referral code in registry */
        $code = $this->hlpReferral->getReferralCode();
        if ($code) {
            /* and return referral group if code exists */
            $groupId = $this->hlpConfig->getReferralsGroupReferrals();
            $result = $this->daoCustGroup->getById($groupId);
        }
        return $result;
    }
public function aroundGetNotLoggedInGroup ( \ Magento \ Customer \ Model \ GroupManagement $ subject , \ Closure $ proceed ) { /* call parent to process other around-plugins */ $ result = $ proceed ( ) ; /* check referral code in registry */ $ code = $ this -> hlpReferral -> getReferralCode ( ) ; if ( $ code ) { /* and return referral group if code exists */ $ groupId = $ this -> hlpConfig -> getReferralsGroupReferrals ( ) ; $ result = $ this -> daoCustGroup -> getById ( $ groupId ) ; } return $ result ; }
Get referral group data instead of anonymous group.

@param \Magento\Customer\Model\GroupManagement $subject
@param \Closure $proceed
@return \Magento\Customer\Api\Data\GroupInterface
@throws \Magento\Framework\Exception\LocalizedException
Get referral group data instead of anonymous group .