I am trying to get state code form Region ID. e.g. If my region id = 12 state code should be CA. This is what I am doing right now.
$regionObject = $objectManager->get('Magento\Directory\Model\RegionFactory');
$regionModel = $regionObject->create();
$region = $regionModel->loadByCode($regionId, $countryCode);
$shipFromState = $region->getName();
I am trying to get shipping origin address. If there is a good way to get the address that will be nice. Currently I am getting shipping information using following code
$scopeConfig = \Magento\Framework\App\ObjectManager::getInstance()
->get('\Magento\Framework\App\Config\ScopeConfigInterface');
$regionId = $scopeConfig->getValue('shipping/origin/region_id', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);