Developer forum

Forum » Integration » When is the ShippingMethodCode sent to ERP in LiveIntegrations?

When is the ShippingMethodCode sent to ERP in LiveIntegrations?

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have a project that is integrated with BC.
We have defined a couple of ShippingMethods in DW, according to the definitions and codes in BC.

On the carts, I see that the value for ShippingMethodCode is saved correctly on the order. But I don't see it being sent to BC. The PaymentMethodCode, however, is included in the EcomOrder XML. Is there anything else (apart from the code value) that triggers the inclusion of this information in the order XML?

Thank you,

Adrian 


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Adrian,

the thing is that order ShippingMethodCode value is sent only when the checkbox "ERP controls shipping" is un-checked. The xml tag is called "OrderShippingCode" which contains the Dynamicweb order.ShippingMethodCode value.
BR, Dmitrij

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Dmitrij,

In my case, I need to send that ShippingMethodCode to BC in order to tell BC which method it should use to calculate the Shipping cost :)
Which seems to be the other way around how it was meant to work.

Any idea on how I could accomplish this?

Thank you,
Adrian

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Yes, you need to use some custom code that will do this:
1) Subscribe to OnBeforeGenerateOrderXml:
settings.ErpControlsShipping = false;
2) Subscribe to OnAfterGenerateOrderXml:
settings.ErpControlsShipping = true; // Restore changed value back 

 

You must be logged in to post in the forum