@wpelvis It sounds like you are saying WC has a join object – WC_Order_Item. I can see it in my test install, in the woocommerce_order_items table, I assume. But as far as I can tell, this object does not show as an object that can be mapped in this plugin, by default. I see that WooCommerce has code that refers to it as order_item
.
Here’s what you can try, though:
1. There’s a filter in this plugin that allows you to add additional WordPress objects that can be mapped. You can use it like this:
add_filter( 'object_sync_for_salesforce_add_more_wordpress_types', 'add_more_types', 10, 1 );
function add_more_types( $wordpress_object_types ) {
$wordpress_object_types[] = 'order_item'; // this will add the object to the existing types. It assumes it is a custom post type at this point, though you can change that later
return $wordpress_object_types;
}
2. You could then map it to whatever the object in Salesforce is.
3. You’d presumably have fields that you need to map that aren’t default fields. This is more complicated with non-standard objects, because the plugin needs to know how those fields get created, updated, read, deleted. WooCommerce may have methods for this already, and if it does you could use those. The hook to use is object_sync_for_salesforce_wordpress_object_fields
.
There’s some documentation about using that hook here: https://github.com/MinnPost/object-sync-for-salesforce/blob/master/docs/extending-mapping-options.md. But again, it can be rather complicated to find all the methods; I know WooCommerce is a large system.
In any case, I think this would work for you. You just need to tell the plugin about the custom object, what data fields it has, how to create/read/update/delete that data, and where it should be sent in Salesforce.
If you build a plugin that does this, we’d happily link to it/encourage users to install it, if they install our plugin while running WooCommerce.