Introduction
I am working on a plugin which will need a "Confirm" button hide on some condition (written in action filter).
Question:
How to hide Confirm button on checkout page from plugin in nopcommerce.
Problem
Actually i cannot make view overrides (and using ViewData) as suggested in some solutions but i cant do override in views.
Thinking about having solved from action filter i wrote for /Checkout/Complete --get
//if checkout process is generic
bool IsCheckoutConfirm = (filterContext.RouteData.Values["controller"].Equals("Checkout")
&& (filterContext.RouteData.Values["action"].Equals("Confirm")) && filterContext.HttpContext.Request.HttpMethod == "GET");
If someone have idea or know how it can be done, please help me out. Thanks for your time.
The easiest way to do this is to make a copy of the Confirm.cshtml page and put it one of these two places:
Once you have your copy of the Confirm.cshtml you can wrap the confirm button inside an "if" condition, coded for the Boolean value in your plugin that determines whether to expose the button.
There are a variety of ways to pass that value, either by extending the CheckoutConfirmModel in your plugin, action filters, etc.