yeah we tried what you suggested but didn't work.
Did you get a chance to write your own plugin for the same thing?
builder.RegisterType<MyPriceCalculationService>().As<IPriceCalculationService>().InstancePerLifetimeScope();
public partial class MyPriceCalculationService : PriceCalculationService, IPriceCalculationService
{
#region Fields
private readonly IWorkContext _workContext;
private readonly IStoreContext _storeContext;
private readonly IDiscountService _discountService;
private readonly ICategoryService _categoryService;
private readonly IManufacturerService _manufacturerService;
private readonly IProductAttributeParser _productAttributeParser;
private readonly IProductService _productService;
private readonly ICacheManager _cacheManager;
private readonly ShoppingCartSettings _shoppingCartSettings;
private readonly CatalogSettings _catalogSettings;
#endregion
#region Ctor
public MyPriceCalculationService(IWorkContext workContext, IStoreContext storeContext,
IDiscountService discountService,
ICategoryService categoryService,
IManufacturerService manufacturerService,
IProductAttributeParser productAttributeParser,
IProductService productService,
ICacheManager cacheManager,
ShoppingCartSettings shoppingCartSettings,
CatalogSettings catalogSettings): base( workContext, storeContext,
discountService,
categoryService,
manufacturerService,
productAttributeParser,
productService,
cacheManager,
shoppingCartSettings,
catalogSettings)
{
this._workContext = workContext;
this._storeContext = storeContext;
this._discountService = discountService;
this._categoryService = categoryService;
this._manufacturerService = manufacturerService;
this._productAttributeParser = productAttributeParser;
this._productService = productService;
this._cacheManager = cacheManager;
this._shoppingCartSettings = shoppingCartSettings;
this._catalogSettings = catalogSettings;
}
#endregion
public override decimal GetFinalPrice(Product product,
Customer customer,
decimal additionalCharge,
bool includeDiscounts,
int quantity,
DateTime? rentalStartDate,
DateTime? rentalEndDate,
out decimal discountAmount,
out Discount appliedDiscount)
{
Discount appliedDis = new Discount();
appliedDiscount = appliedDis;
discountAmount = decimal.Zero;
///new calculation logic
decimal price = product.Price + 10; //just sample
return price;
}
}
}