Hello,
I am implementing some kind of sorting options for a nopCommerce project.
I think it would be a nice idea to add some more fields at product entity like:
- Total Sells
- Page Views
- Extra weight
What do you think ?
Thanks
public ActionResult Completed(int? orderid)
{
//validation
if ((_workContext.CurrentCustomer.IsGuest() && !_orderSettings.AnonymousCheckoutAllowed))
return new HttpUnauthorizedResult();
//model
var model = new CheckoutCompletedModel();
//Added
if(orderid !=null)
{
var o = _orderService.GetOrderById(orderid.Value);
if(o == null) throw new Exception("Order cannot be null");
model.OrderId = o.Id;
return View(model);
}
var orders = _orderService.GetOrdersByCustomerId(_workContext.CurrentCustomer.Id);
if (orders.Count == 0)
return RedirectToRoute("HomePage");
else
{
var lastOrder = orders[0];
model.OrderId = lastOrder.Id;
}
return View(model);
}