function globallink_commerce_save_field_collections in GlobalLink Connect for Drupal 7.7
1 call to globallink_commerce_save_field_collections()
- globallink_commerce_import in globallink_commerce/
globallink_commerce.inc
File
- globallink_commerce/
globallink_commerce.inc, line 746
Code
function globallink_commerce_save_field_collections($entity, $translated_arr, $target_locale) {
$field_arr = field_info_instances('commerce_product', $entity->type);
$keys = array_keys($field_arr);
foreach ($keys as $field) {
$language = field_language('commerce_product', $entity, $field, NULL);
$field_values = field_get_items('commerce_product', $entity, $field, $language);
if (isset($translated_arr['field_collection'][$field])) {
foreach ($field_values as $entity_id_arr) {
if (isset($entity_id_arr['value'])) {
$fc_entity_id = $entity_id_arr['value'];
globallink_commerce_save_field_collections_recursively('commerce_product', $entity, $fc_entity_id, $translated_arr['field_collection'][$field], $target_locale);
}
}
}
}
}