Plugin that pulls information in via SOAP for product cost and description

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 years ago
I'm attempting to create a plugin that pulls in price and description for a product from a web service. This plugin also requires its own checkout page with product information at the top, and then the rest of the standard one page checkout below.

I done things like this in the past on ver 1.9 and such by adjusting the core files but I'm attempting to do this via a plugin and I'm looking to answer two questions. One is it possible via a plugin only, and two hints on how I would go about doing it.

Thank you,
9 years ago
Hi,

To your first question.

bhiers wrote:
Is it possible via plugin only?


Yes it is and here's some hints about doing it:

You could use the ProductService from Nop.Services or you could write your own. Actually if you need only price and description you should write your own, because there is no point of pulling all the product info from the database.

For the checkouts you could create your own CustomCheckoutController that inherits the CheckoutController and has an Action method which will handle the display of product information.

You could use some kind of Action Filter or override the One Page Checkout View to display the checkout information.
9 years ago
Thank you, your hints are great and pointed me into the correct direction.
9 years ago
One issue I found is that the servicemodel bindings and endpoint need to be in the web.nop web.config and are not used from the app or web config in the plugin project.
9 years ago
And I'm a moron, way down on my todo list was to make all the soap call stuff dynamic, done and fixed.
9 years ago
bhiers wrote:
One issue I found is that the servicemodel bindings and endpoint need to be in the web.nop web.config and are not used from the app or web config in the plugin project.


Is the app config getting copied to the Presentation/Plugins/{PluginName} directory?
9 years ago
I've found the plugins don't end up using the local web.config and any special configuration needs to be added to the main web.config
9 years ago
What about PluginName.dll.config?
9 years ago
I have made an Plugin that pulls price from SOAP Service.

1. Override PriceCalculationService (GetFinalPrice and GetUnitPrice) or implement IPriceCalculationService on your own.
2. Add your WebService reference in your plugin project. You can create WebServiceClient with Settings from SettingsService
eg.

var myEndpointFromSettings = _settingService.GetSettingByKey<string>("MyPlugin.WebServiceUrl", "http://localhost:9000/GetSomePrice/");
this._client = new MyServiceClient(new BasicHttpBinding(), new EndpointAddress(myEndpointFromSettings));

3. Register PriceCalculationService:

public void Register(Autofac.ContainerBuilder builder, Core.Infrastructure.ITypeFinder typeFinder)
{
  builder.RegisterType<MyPriceCalculationService>().As<IPriceCalculationService>().InstancePerHttpRequest();
}
9 years ago
AndyMcKenna wrote:
What about PluginName.dll.config?


Previous development has shown it does not get read. I've had to apply any changes to the plugin.dll.config to the main web.config.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.