I try to override ShoppingCartService from my plugin.
I register my class:
services.AddScoped<IShoppingCartService, MyShoppingCartService>();
I create my class :
public class MyShoppingCartService : ShoppingCartService ,IShoppingCartService
{
public MyShoppingCartService(IWorkContext workContext, IProductService productService, IProductAttributeParser productAttributeParser, ICheckoutAttributeParser checkoutAttributeParser, ICustomerService customerService, IMediator mediator, IUserFieldService userFieldService, IProductReservationService productReservationService, IShoppingCartValidator shoppingCartValidator, ShoppingCartSettings shoppingCartSettings) : base(workContext, productService, productAttributeParser, checkoutAttributeParser, customerService, mediator, userFieldService, productReservationService, shoppingCartValidator, shoppingCartSettings)
{
}
public override Task<IList<string>> AddToCart(Customer customer, string productId, ShoppingCartType shoppingCartType, string storeId,
string warehouseId = null, IList<CustomAttribute> attributes = null, double? customerEnteredPrice = null,
DateTime? rentalStartDate = null, DateTime? rentalEndDate = null, int quantity = 1,
bool automaticallyAddRequiredProductsIfEnabled = true, string reservationId = "", string parameter = "",
string duration = "", bool getRequiredProductWarnings = true)
{
return base.AddToCart(customer, productId, shoppingCartType, storeId, warehouseId, attributes, customerEnteredPrice, rentalStartDate, rentalEndDate, quantity, automaticallyAddRequiredProductsIfEnabled, reservationId, parameter, duration, getRequiredProductWarnings);
}
}
My code not working.
Is there any additional task that I should do?
Thanks.