November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Yes, for a it's definitely possible. You'll need to implement IPriceService and IPriceDetailService and then register them in the initialization module.
For b, unfortunately I don't know for sure :)
Regards.
/Q
Implementing a custom price service is not very hard. I've created a random price service that creates a random price for an sku if no price exists. Perfect for mocking prices when you don't have your price integration in place.
Is the price source fast enough and reliable enough to integrate it directly? Another solution would be to periodically import the prices to EPi, let's say x times a day. If prices change often or the client needs them to get updated in EPi in almost-real-time you could also make an incremental import every x minutes.
I am on EPI Server Commerce 7.5. It would be great if I have a refference example on how to create and register your custom pricing module..
Hi,
As I said, it's quite easy.
In your project, create new two classes:
public class CustomPriceService : IPriceServide
{
//implement custom methods here
}
public class CustomPriceDetailService : IPriceDetailService
{
//implement custom methods here
}
Then you'll need an Initialization module, like this:
[ModuleDependency(typeof(EPiServer.Commerce.Initialization.InitializationModule))]
public class InitializationModule : IConfigurableModule
{
public void Initialize(InitializationEngine context)
{
}
public void Preload(string[] parameters)
{
}
public void Uninitialize(InitializationEngine context)
{
}
public void ConfigureContainer(ServiceConfigurationContext context)
{
context.Container.Configure(c => c.For<IPriceServide>().Use<CustomPriceService >());
context.Container.Configure(c => c.For<IPriceDetailServide>().Use<CustomPriceDetailService >());
}
}
Hope this helps.
/Q
Hi Quan,
That's easy now. Is there any chance we can source code for the base IPriceDetailService and IPriceService?
we will be making very minor change to the current working code so I was wondering if we can utilize the already existing code instead of reinventing the wheel.
Thanks,
syed
Hi,
I am not allowed to publish source code of EPiServer Commerce - except parts which we made open source. For your purpose, you need to contact our Developer support service or our Expert services for consultant.
Regards.
/Q
Hi Quan, I thought it was part of the open source. I will contact the development support service.
Thanks,
Syed
Hi,
I have implemented my custom price service.
Added both in
Initialization module.
context.Container.Configure(c => c.For<IPriceDetailService>().Singleton().Use<OxxCommerceStarterKit.PriceService.CustomPriceService>());
context.Container.Configure(c => c.For<IPriceService>().Singleton().Use<OxxCommerceStarterKit.PriceService.RandomPriceService>());
But the code is not working when i am importing prices using csv.
Is there anything special i need to do to work it.
Very Urgent.
Please help.
Hi, was wondering if (a) is it possible, and (b) has anyone implemented their own pricing provider for commerce?
Our client stores product pricing in an external database that we'd like to access via the standard commerce pricing interface.