|Number of votes:||6|
In Commerce 8.0, we have dropped the dependency to EPiServer Common Framework. When dropping the dependency, we had to remove all classes in EPiServer.Business.Commerce which had dependencies to EPiServer Common Framework. With the dropped classes, we dropped some functionality. This blog post will show how to recreate the missing functionality.
When we dropped the dependency to EPiServer Common Framework, we lost comments and ratings, which has been a part of Commerce in earlier versions. This will cause problems when upgrading to Commerce 8, if the site uses comments or rating.
The following classes have been dropped from EPiServer.Business.Commerce:
In “EPiServer CommonFramework”, there is functionality for logging, which will help developers to find problems in the code. This code will not be available anymore as long as the “EPiServer CommonFramework” nuget package isn’t explicitly installed on the site. Projects that has used EPiServer Common logging should change to work directly against “log4net”. By changing the using statement to “log4net”, log4net will start handling the logging.
To add back comments and ratings after upgraded to Commerce 8, the following steps are needed:
After you have the classes in to your project, you have to add a couple of lines to an initialization module:
// register entity provider with supported types EntityProviderHandler.Instance.RegisterEntityProvider<DynamicEntityProvider, DynamicEntity>(); EntityProviderHandler.Instance.RegisterEntityProvider<DynamicEntityProvider, ProductEntity>();