--- /home/JOlstad/public_html/wet/sites/all/modules/drupal_7_port_of_money_cck_field/money.module	2012-07-31 15:30:03.000000000 -0400
+++ money.module	2012-08-20 16:23:28.000000000 -0400
@@ -450,3 +450,81 @@
 function money_field_widget_error($element, $error, $form, &$form_state) {
   form_error($element, $error['message']);
 }
+
+
+/**
+ * Implementation of hook_feeds_processor_targets_alter().
+ * added by Joseph.Olstad aug 20, 2012
+ * @see FeedsNodeProcessor::getMappingTargets().
+ */
+
+function money_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_name) {
+  foreach (field_info_instances($entity_type, $bundle_name) as $name => $instance) {
+    $info = field_info_field($name);
+    if ($info['type'] == 'money') {
+      $targets[$name . ":amount"] = array(
+        'name' => $instance['label'] . ': Amount',
+        'callback' => 'money_feeds_set_target',
+        'description' => t('The price amount for the @name field.', array('@name' => $instance['label'])),
+        'real_target' => $name,
+      );
+      $targets[$name . ":currency_code"] = array(
+        'name' => $instance['label'] . ': Currency',
+        'callback' => 'money_feeds_set_target',
+        'description' => t('The currency for the @name field.', array('@name' => $instance['label'])),
+        'real_target' => $name,
+      );
+    }
+  }
+
+}
+
+
+/**
+ * ajouté 20 août, 2012 par Joseph Olstad
+ * Callback for mapping. Here is where the actual mapping happens.
+ *
+ * When the callback is invoked, $target contains the name of the field the
+ * user has decided to map to and $value contains the value of the feed item
+ * element the user has picked as a source.
+ */
+function money_feeds_set_target($node, $entity, $target, $value) {
+
+/* copied section below from commerce_price_feeds_set_target
+ * http://api.drupalcommerce.org/api/Drupal%20Commerce/sites!all!modules!commerce_feeds!mappers!commerce_price.inc/function/_commerce_price_feeds_processor_targets_alter/DC
+ */
+  if (!isset($value)) {
+    return;
+  }
+
+  // Handle non-multiple value fields.
+  if (!is_array($value)) {
+    $value = array($value);
+  }
+
+  // Get field information.
+  list($field_name, $sub_field) = explode(':', $target);
+  $info = field_info_field($field_name);
+
+//end of copied section (from commerce_price_feeds_set_target)
+
+  $field = isset($node->$target) ? $node->$target : array();
+
+  // Handle multiple value fields.
+  if (is_array($value)) {
+    $i = 0;
+    foreach ($value as $v) {
+      if (!is_array($v) && !is_object($v)) {
+        $field[$i]['amount'] = $v;
+      }
+      $i++;
+    }
+  }
+  else {
+    $field[0]['amount'] = $value;
+  }
+
+   $entity->{$field_name} = $field;
+
+}
+
