Recent Topics

State code showing instead of State Name in customer/address page



  • 1.PNG
    Only State code showing in customer/address page. Isn't it obvious that the default_name of state would show like country?

    For country
    public function country_name($code)
    {
    $country = $this->countryRepository->findOneByField('code', $code);

        return $country ? $country->name : '';
    }
    

    For state ?



  • Hi @RK-REZA

    We have also created findStateByCountryCode function also in same file, pass your country and state code in this function like core()->findStateByCountryCode($address->country, $address->state).
    You will get CoutryState Model data (https://prnt.sc/peqr99 ) and print's its default name, you will get state name.

    Thanks


Log in to reply