Developer forum

Forum » Integration » Missing Product URLs When Using Ecommerce ShopUrlDataProvider in DW 10.17.3

Missing Product URLs When Using Ecommerce ShopUrlDataProvider in DW 10.17.3

Vincent Gercke
Reply

Hi,

We have a customer running Dynamicweb version 10.17.3 who is using the ShopUrlDataProvider (AddInName: Ecommerce). Products are imported via data integration, meaning they are not maintained through the backend administration interface.

The issue we're facing is that product URLs are not being generated for newly imported products. It appears that this is due to the GroupProductRelationIndex and ProductUrlDataIndex properties not being cleared or updated as part of the import process.

As far as I can tell, these properties cannot be cleared programmatically, and they are not implemented as service caches either.

Am I missing something here—or is there another recommended approach to resolve this issue?

Thanks in advance.


Replies

 
Vincent Gercke
Reply

Anyone?

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Vincent,
it looks like there is no available way to clear that cached data, but I can try to look and provide some sample custom C# code that can be used for forcing it to clear using the Data integration JobFinised Dynamicweb extensibility api. Let me know if that can work for you.
BR, Dmitrij

 
Vincent Gercke
Reply

That would be great, thank you!

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Vincent,
you can try to use this code and change the job name to yours in it:
 

using Dynamicweb.Extensibility.Notifications;
using static Dynamicweb.Ecommerce.Frontend.UrlHandling.ShopUrlDataProvider;

namespace Dynamicweb.DataIntegration;

[Subscribe(Integration.Notifications.Integration.JobFinished)]
public class JobFinishedSubscriber : NotificationSubscriber
{
    public override void OnNotify(string notification, NotificationArgs args)
    {
        var integrationArgs = args as Integration.Notifications.Integration.JobFinishedIntegrationArgs;
        if (integrationArgs is null)
            return;

        if (string.Equals(integrationArgs.Job.Name, "job1", System.StringComparison.OrdinalIgnoreCase))
        {
            ProductGroupRelationChangedObserver observer = new ProductGroupRelationChangedObserver();
            observer.OnNotify(notification, new Ecommerce.Notifications.Ecommerce.Product.ProductGroupRelationAfterSaveArgs(null, null));

            ProductChangedObserver productChangedObserver = new ProductChangedObserver();
            productChangedObserver.OnNotify(notification, new Dynamicweb.Ecommerce.Notifications.Ecommerce.Product.AfterSaveArgs(null));
        }
    }
}

BR, Dmitrij

 
Vincent Gercke
Reply

Hi again

Thank you for the example. We've done something similar on our end to fix the issue, but I was hoping for a more "clean" way to clear the cache. It would be nice to be able to clear the cache as Service cache since we would be able to configure it on the data integration job, no need for code :-)

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Vincent

I am looking into it.

BR Nicolai

 

You must be logged in to post in the forum