Let me know if you find a solution. Have the same issue.
Hi @jaak69
It sounds like you could use a PHP function or our API to translate the values.
Can you provide more details on where you’re importing the “countryID” data? Is it a custom field, a taxonomy, or something else? If you have some data examples that would be helpful as well.
Thread Starter
jaak69
(@jaak69)
Hello,
This is a custom field:
It looks in import csv:
country_id
0
53
0
17
0
0
And the mapping csv:
country_id
1 Eesti EE
3 Venemaa RU
4 Soome FI
11 Leedu LT
12 Läti LV
13 Poola PL
14 Hispaania ES
15 Itaalia IT
16 Türgi TR
17 Hiina CN
18 Andorra AD
19 Araabia Ühendemiraadid AE
20 Albaania AL
21 Armeenia AM
….
etc.
Hi @jaak69
Thank you for the example. Unfortunately, there are currently no built-in options to import mapping rules like this, but you could do it with your own custom solution.
You should convert the mapping CSV to a PHP array (see str_getcsv), then write a PHP function for the mapping rules. Example:
// Map function
function my_map_field( $data ) {
// Replace this array with the data from your CSV file
$map = array(
'Translate This' => 'To This New Value',
'And this' => 'To this',
'Add as many' => 'Rules',
'As you need' => 'In this array',
);
return isset( $map[ $data ] ) ? $map[ $data ] : $data;
}
You can use that function in the import template as described here: http://www.wpallimport.com/documentation/developers/execute-php/.