Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

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

    Bug Report
    2
    2
    320
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      RK REZA last edited by

      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 ?

      1 Reply Last reply Reply Quote 0
      • R
        rahul last edited by

        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

        1 Reply Last reply Reply Quote 0
        • First post
          Last post