Posted on 12/06/2023 12:29:54
Hi, Morten, from what I can see everything is available to the scheduled task. The settings are just not set but ignored.
We have access to the feed in the FeedExportHelper GenerateFile.
Here we can set both shop and user id on the FeedContextConfiguration, we just need to encrypt the userid, as the code further down expects to get the user id passed in that format.
- feedContextConfiguration.UserId = Crypto.Encrypt(feed.UserId.ToString());
- feedContextConfiguration.ShopId = feed.ShopIds.FirstOrDefault();
When inserting these two lines both are passed correctly to the PriceContext.
It is also possible to get language and currency code directly from the feed in the same way.
I think there is a possible confusion in what part of the code is responsible for handling the feed settings. When I use a Scheduled task in this way, where I pass it a feed, my expectations are that the setting on the feed is honoured. Right now, the responsibility is given to the scheduled task, and I can’t really see the reason as to why that is the case? Everything we need for the FeedContextConfiguration is already present on the feed.
I can see a case for allowing the scheduled task to override default feed settings, but from what I can see right now its the settings from the scheduled task or no settings.