I m trying to overWrite route for order details. So, I create RoutePrivoder class with this code:
routes.MapRoute("Plugin.Payments.Receipt.OrderDetails",
"OrderDetails/{id:int}",
new { controller = "PaymentReceipt", action = "OrderDetails", id = UrlParameter.Optional },
new[] { "Nop.Plugin.Payments.Receipt.Controllers" }
);
And create ActionResult in this controller PaymentReceiptController. I set up breakpoint in my controller on method OrderDetails. And I see that parameter orderId is empty. Could u please tell me why its empty?
public virtual ActionResult OrderDetails(string orderId)
{
var order = _orderService.GetOrderById(Convert.ToInt32(orderId));
if (order == null || order.Deleted || _workContext.CurrentCustomer.Id != order.CustomerId)
return new HttpUnauthorizedResult();
//var model = _orderModelFactory.PrepareOrderDetailsModel(order);
//model.PrintMode = true;
return View("~/Plugins/Payments.Receipt/Views/PaymentInfo.cshtml");
}