Hi,
Just to clarify a bit the situation, we will not use that code when we will implement that feature.
That code is a temporary code to manage that situation, but the final code will use database queries to get the desired data from the zone table.
Here is a new version of that temporary code, not tested.
foreach($params->elements as $i => $element){
foreach($element->address as $j => $row){
if(isset($row->address_state)){
$row->address_state = str_replace('_',' ',str_replace('state_','',preg_replace('#_[0-9]*$#','',$row->address_state)));
}
if(isset($row->address_country)){
$row->address_country = str_replace('_',' ',str_replace('country_','',preg_replace('#_[0-9]*$#','',$row->address_country)));
}
}
}