Developer forum

Forum » Integration » Discount codes for DW9 and BC cloud / "ERP controls discount calculations"

Discount codes for DW9 and BC cloud / "ERP controls discount calculations"

Jacob Nilsson
Reply

We have a solution where we need to use DW9 campaigns for b2c customers(anonymus) and where b2b customer prices are handled in BC cloud. We are using the DynamicWeb plugin unit for BC in a pretty standard way with live integrations etc.

For b2c customer we need to handle the discount code calculations on the DW side since campaign codes are not really supported in BC. For b2c customer it works fine if we uncheck the live integration option “ERP controls discount calculations”. However, doing that makes the b2b customer prices handled in BC stop working.

Is there any simple non custom live integration way to just do b2c/anonymus discount calculations on the DW and handle 2b2 customer prices on the b2b side?
Some way to make the “ERP controls discount calculations” option to not apply for b2c/anonymus customers?

We had the same issue using nav where the solution was to use the custom live integration source code and a hack solution in OrderHandler to handle b2c discount calculations in DW and the b2b customer calculations in the ERP.

Is there any general recommended way in handling discount codes in a DynamicWeb with BC cloud setup. Seems like it should be a fairly common setup.


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Jacob,
it looks like there is no out of the box solution for that. We support having several Live Integration instances but they require a different shop being selected/connected to in them so I am not sure it could not help in this case.

You can try to use the Live integration extensibility api like that so switch on/off the discounts for the definite users in the subscribers that will generate the request to BC with or without discounts:
1) Subscribe to OnBeforeGenerateOrderXml:
settings.ErpControlsDiscount = true; 
2) Subscribe to OnAfterGenerateOrderXml:
settings.ErpControlsDiscount = false; // Restore changed value back

BR, Dmitrij

 

 

You must be logged in to post in the forum