Extending Tier Prices

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 years ago
We are new to Nop commerce and somewhat familiar with C# and .NET and are looking for some advice. We are currently attempting to add an additional point(decimal) column to inventory. This new column needs:
- to be set individually for each item and each price.
- be displayed anywhere price would be.

We are currently planning on extending the Tier Pricing and inventory tables to contain this new column as tier pricing's functionality could match what we are looking for.

A widget plugin doesn't seem to fit our needs for displaying the new point column as the placement of this new information would need to be very close to the price. The placement products information at that level in the view seems to change from Theme to Theme. As such, we plan on directly modifying any theme view we wish the plugin to work with. Extending the various entities and models with partial classes/records within Nop's source code. Then using these new columns to extend/override any services/functions with a plugin.

One such  functions we would likely be changing, Nop.Services.Catalog.PriceCalculationService.GetFinalPriceAsync(), seems like it would be a problem. The function currently returns a named tuple with 4 values. We believe we would need to modify this to return the new point value as this is where tier pricing is calculated. However this means we would potentially have to modify all 20+ places this function is used. Is this the case or are we looking in the wrong places?

We are curious if our approach to the general solution is adequate or if someone has a different direction for us.
2 years ago
This document describes how to add properties to core domain entities.
https://docs.nopcommerce.com/en/developer/tutorials/update-existing-entity.html

I do recommend that even if you modify the core domain that way, that you still create plugins to override core service methods.  Doing logic in your own plugins will make it easier to upgrade to new nopCommerce versions in the future.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.