Developer forum

Forum » Integration » Separate Live Integration settings per Shop

Separate Live Integration settings per Shop

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have a situation where I have 2 shops in the same solution. For one of them, I want to use Live integration with all the functionalities. For the other one, I want to use just the Order synchronization. Prices should be handled by the regular PriceField.

I see that the LiveIntegrationSettings allow for Shop selection. But I don't see a way to add 2 separate LiveIntegration settings/configurations.

Is this supposed to be supported? Or planned to be supported in the future?

Thank you,
Adrian


Replies

 
Anders Ebdrup
Anders Ebdrup
Reply

I would very much like Dynamicweb to support this scenario :-)

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

I don't see any reason why they should not. We have seen an increased number of situations where we have to make at least 2 separate integrations in the same solution. And I expect this trend to increase as we target PIM customers.

They should have this challenge on their own projects.

Let's see if we get anybody's attention with this :)

Thank you for your continuous support :)

Stay safe!

Adrian

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi DW, anybody any answer to this?

Any suggestion?

Thank you,
Adrian

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Adrian,
By default the one standard Live Integration does not support this. But you could make a few changes and compile a new LiveIntegration2.dll with the same code but changed only this:






Then you will have two Live integrations listed:

Then you are able to Enable each integration and set the appropriate Shop in the Shop setting drop-down and configure other options per each integration.
I've attached this code here in the zip archive so you could use the Dynamicweb.Ecommerce.LiveIntegration2.dll from the bin folder.

Kind regards, Dmitrij

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Dmitrij,

Thank you very much for the code sample. It is very helpful.

Until Dw decides to integrate it into the LiveIntegration settings, I will have to settle for this option.

Thank you,

Adrian

 
Dan Kristensen Hørlyck
Dan Kristensen Hørlyck
Reply

Hi Adrian,

Thank you for bringing this scenario forward. It is a cool feature and I can clearly see how it can provide value in other solutions.

Right now, I think the best you can do is to use Dmitrij's workaround. Use it first, then give us your feedback and let us know whether it solves your immediate needs. If there are minor hiccups we will figure something out.

Obviously this is not a long term solution. We need to figure out a standard way to instantiate multiple "live integrations" without resorting to recompilation. 

The great news is that the standard solution would be built by Dmitrij, so whatever you and he learns now, can be built into the standard solution.


Sincerely,
Dan 
Product Manager, Integrations
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Dan,

Thank you for your feedback.

What we were trying to avoid is building custom code because, in the long run, it will be harder and harder to maintain.

That's why a built-in way to support multiple integrations would be helpful.

Dmitrij code seems fine and I have no doubt it will work just fine.

I will get back to you if we stumble on anything.

Thank you,

Adrian

 
Martin Grønbekk Moen
Martin Grønbekk Moen
Reply

Hi Dmitrij!

I tried this, and it works for the live integration.
But when i added the second DLL I suddently got this error on batch integration.

When I remove the second DLL, everything is fine. Any thoughts?

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply
This post has been marked as an answer

Hi Martin,
Could you try to rename the QueuedOrdersSyncScheduledTask class to QueuedOrdersSyncScheduledTask2 or something else and try again?
Kind regards, Dmitrij

Votes for this answer: 1
 
Martin Grønbekk Moen
Martin Grønbekk Moen
Reply

Thanks! It worked ;)

 
Jose Caudevilla
Reply

Hi,

I have two shops in my solution, i need take the prices from diferent URL for each shop.

Following the Dmitry steps works well, but i have a problem with the live integration settings.

 

When i press "save" button my configuration is removed.

 

For example i set this configuration:

 

When i press save button my configuration disapear:

 

When i remove one of my integrations i dont have this problem.

 

Thanks,

Jose.

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Jose,
it looks like you have forgot to rename the second add-in name in the Constants.cs file.
Try to check if you have put something not equal to "ERPLiveIntegrationAddIn" there.
Kind regards, Dmitrij

 
Lars Sørensen Dynamicweb Employee
Lars Sørensen
Reply

If there are other settings e.g. related to anonymous users vs. known users, you can be used to differentiate the connection to ERP without a separate settings page, you might be able to uses these settings (source: https://doc.dynamicweb.com/documentation-9/integration/integration-framework-2/live-integration):

The live integration supports multiple endpoints, with each endpoint requiring a unique URL and a matching connector service – 2 endpoints = 2 connectors.

The URL syntax is [URL];[Field];[Value] - with the Field property retrieving data from either of these fields:

  • User.Company – AccessUserCompany column of table AccessUser
  • User.Department – AccessUserDepartment column of table AccessUser
  • User.[Any custom field] – System name(!) of any custom field column of table AccessUser
  • Order.[Any custom field] – Any custom field column of table EcomOrder
  • Session.Shop – ShopID of the shop in current http context

Edit the link directly (web service URL) or double-click an endpoint and add the parameters (endpoints).

 

 

Also, there is a setting on the user, "Disable live prices", that - well - does exactly what it says :-)

 

You must be logged in to post in the forum