Is there any plugin that will prevent the customer from ordering more than (x) products in a 24-hour period and if not can someone point me to the area in the project code where I can implement this myself?
I just added this in the ConfirmOrder method, it's quick and dirty with a hard-coded value, but does the job. As you can see I am not a NOP developer.
// ClickAlgo - limit free orders to 10 a day. var customer = _workContext.CurrentCustomer; var orderItems = _orderService.GetDownloadableOrderItems(customer.Id); int todaysOrders = orderItems.Where(x => (x.PriceInclTax == 0)).Where(x => x.Order.CreatedOnUtc.Date == DateTime.UtcNow.Date).Count();
if (todaysOrders >= 10) { model.Warnings.Add("You have reached your daily quota of 10 free orders per day, please return tomorrow to order more products."); return View(model); }
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.