Last active
July 18, 2016 16:48
-
-
Save pcave/1842c35e4ed8df10a686730bbd705d8e to your computer and use it in GitHub Desktop.
Make product id and type mappable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add new alter hook in _salesforce_mapping_get_entity_fields | |
// Give other modules a chance to alter the entity fields available for mapping. | |
drupal_alter('salesforce_mapping_entity_fields', $entity_fields, $entity_type, $entity_bundle_type); | |
/** | |
* Implements hook_salesforce_mapping_entity_fields_alter(). | |
*/ | |
function salesforce_line_item_salesforce_mapping_entity_fields_alter(&$entity_fields, $entity_type, $entity_bundle_type) { | |
if ($entity_type == 'commerce_line_item' && $entity_bundle_type == 'designation') { | |
$entity_fields['Product']['commerce_product:product_id'] = 'Product ID'; | |
$entity_fields['Product']['commerce_product:type'] = 'Product Type'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment