Inhalte aufrufen

Profilbild

Dynamically compute prices using a provider

dynamic pricing provider

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
2 Antworten zu diesem Thema

#1 JBTB

JBTB

    Member

  • Members
  • PunktPunkt
  • 10 Beiträge

Geschrieben: 08 March 2018 - 16:25

Hello, I have a specific use case where I do not intend to use the Shopping basket-workflow for actual buying of products.

I basically would like to use SmartShop as a catalogue of products and add a custom widget that implements any further actions.

 

Now I have a requirement to show a price which is based on a few variables and dynamically computed, just-in-time. I'm thinkng of developing a provider that will compute the price, just like an IShippingRateComputationMethod provider. Is there any existing extension point I could leverage for that or would I need to modify the core code of SmartStore to add a provider like this?

 

Any other thoughts about how to accomplish this are also welcome,

 

Thanks,

Jeroen



#2 Murat Cakir

Murat Cakir

    SmartStore AG

  • Administrators
  • 1118 Beiträge

Geschrieben: 08 March 2018 - 18:23

There are numerous options for this task. The two most promising are:

  1. Implement a custom IPriceCalculationService in your plugin, or inherit the system default PriceCalculationService and override the relevant parts.
  2. Register MVC action filters anywhere where the view model contains price information and overwrite the system price with your own. Have a look at the DevTools plugin to learn how to implement and register filters.

Murat Cakir
SmartStore AG


#3 JBTB

JBTB

    Member

  • Members
  • PunktPunkt
  • 10 Beiträge

Geschrieben: 08 March 2018 - 22:16

Thanks, override of the PriceCalculationService works perfectly!

Clean & simple, love it.

 

Kind regards,

Jeroen