ViceSoft has developed a WordPress plugin that integrates the WooCommerce shopping plugin with Microsoft Dynamics CRM platform.
Go to WooCommerce -> Settings -> Products -> Dynamics CRM Orders Sync
You enter a price list ID from Dynamics CRM on the settings page.
You enter an API key received in an email when you subscribe to a free trial.
It will sync all the products in this price list after up to 5 minutes.
If you make changes to products in CRM, it will update in WooCommerce after 5 minutes. There is a setting to control how often products are synced.
If there are new products they will be added. If something changed on a product in CRM it will be updated in WooCommerce. If product is deleted in CRM, it will NOT be deleted from WooCommerce.
It will sync orders from WooCommerce to CRM, on order event. If the order cannot sync, it will retry on each hour, until it succeeds.
The plug-in can also create an invoice into Dynamics CRM for that particular order record, which later you can automate to be sent to your customer by e-mail.
We need Dynamics CRM access credentials + your site domain, which we configure in our web2orders service and in return you get an API key with which your plug-in will be operational against your deployment of CRM.
The following screen shows plug-in configuration page:
string Name (from CRM Product Entity)
string Description (from CRM Product Entity)
string ProductUrl (from CRM Product Entity)
string ProductNumber (from CRM Product Entity)
string CurrencyCode (from CRM Product Entity)
decimal Price (from CRM PriceList entity)
decimal RegularPrice (from CRM Product Entity)
decimal StockVolume (from CRM Product Entity)
decimal StockWeight (from CRM Product Entity)
DateTime ModifiedOn (from CRM Product Entity)
Custom Attributes (they need to be defined on CRM Product entity)
bool Featured (crmprefix_featured)
bool Downloadable (crmprefix_downloadable)
string PurchaseNote (crmprefix_note)
int Length (crmprefix_length)
int Width (crmprefix_width)
int Height (crmprefix_height)
array ImageUrls (crmprefix_imageurl)\r\n
A text field containing comma separated list of image urls. They will be used to download the images from those URLs and add them to the product in WooCommerce.
We can also sync -> featured products, length, width, height, virtual or downloadable properties in WooCommerce.
We have defined standard custom attributes for those properties for a CRM product. In order the plugin to find correctly there properties in your CRM, you need to provide entity prefix in plugin settings screen. So it will be like prefix_featured, or prefix_length.
If you set a custom attribute prefix_woocommerce_user_logins on your PriceLevel entity, you can list inside the user logins separated by commas. Then when those users log in to the shop they will see the prices from that price list and not the default prices specified in the price list in the plugin config.
With this support you can configure your CRM to send over specific product entity custom attributes to WooCommerce. Those will be written in the wp_postmeta table of WooCommerce, since a WooCommerce product is implemented as wp_post.
In order to use this solution you have to do several steps:
1. Define a custom attribute named: prefix_vicesoft_crm_to_wp_product_custom_attr on the price list entity.
On the price list you are syncing to WooCommerce, configure the above custom attribute to have the following JSON object:
[{
filedName: ‘clothing_size’,
tag: ‘any value you want to transfer to WordPress for custom handling’
wpTargetMetaKey: ‘clothing_size’,
overrideField: ‘name|description|-name|-description’},
{ …}]
Where filedName is a Product entity, custom attribute name. Without the CRM prefix. This is the product attribute which we will try to read and send its value to WooCommerce.
tag: is a custom value you want to transfer to the WordPress for custom handling. You can use a WordPress action to handle this value.
wpTargetMetaKey: this is the target meta_key which we will write to in the wp_postmeta table for the respective WooCommerce product post.
overrideField: can have one of 4 possible values: name, description, -name or -description. It is not mandatory field. If you specify it, you are saying that you want the custom attribute value clothing_size, to be written to the product Name field and returned in its place. This way you can override CRM Name and Description fields with custom ones. If you say -name, this means to override the field and to not return the custom field to the php client. I.e. this way you do not write additional values to the wp_postmeta table.
The active is defined as:
do_action( ‘vicesoft_dynamicscrm_before_product_custom_attr’, $post_id, $prod, $customAttrDef);
You can attach to it by doing add_action(‘vicesoft_dynamicscrm_before_product_custom_attr’, your_function );
You get the $post_id – which is the Product id post in WooCommerce
$prod – is our product object returned from our API and $customAttrDef is a JSON object of type {
fieldName – CRM custom attr name without prefix.
tag – a custom object where you can pass anything from CRM to WordPress
wpTargetMetaKey – the target key in WordPress wp_postmeta table
value – the custom attr value we are passing from CRM to WordPress
}
We have defined a filter with name: vicesoft_dynamicscrm_order_custom_attr
It passes the $custom: array() – which is an array of form:
$custom[$pref.\’couponcode\’] = $codes;
The above code will attach a custom attribute to the order called new_couponcode -> where $pref is the CRM prefix i.e. new_ and the couponcode is the name of a custom attr on the Order CRM entity.
This is how it is defined in our code:
$custom = apply_filters(‘vicesoft_dynamicscrm_order_custom_attr’, $custom, $pref, $order_id, $order);
You have to handle this filter if you want to add to the $custom array all custom attributes you need to pass to the Order entity. As additional arguments to the filter you get $prefix, the order_id in WooCommerce and the $order object which is of type WC_Order.
We support Dynamics CRM Online / OnPremise with IFD, versions 2013, 2015, 2016, O365 and onwards. The security of data transfered is guaranteed with https.
Instructions how to install and configure you will find in the free trial welcome email.
Supported WordPress versions: latest down to 3.