To the developers - is this something you'd consider adding as an official feature?
I demoed NopCommerce to my bosses today and they were very impressed, so much so that they wondered if we could use it not just for a public store but for taking orders from our resellers. Resellers need to pay by purchase order, general customers don't. If we could filter the payment providers by role that would be great.
I know I can hack this into my own copy with some conditional code but it seems like a very useful feature to me and I want to avoid making too many changes from the official files so as to smooth the upgrade path.
To the developers - is this something you'd consider adding as an official feature?
I demoed NopCommerce to my bosses today and they were very impressed, so much so that they wondered if we could use it not just for a public store but for taking orders from our resellers. Resellers need to pay by purchase order, general customers don't. If we could filter the payment providers by role that would be great.
I know I can hack this into my own copy with some conditional code but it seems like a very useful feature to me and I want to avoid making too many changes from the official files so as to smooth the upgrade path.
(1) In \NopCommerceStore\Modules\CheckoutPaymentMethod.ascx.cs (~ Line 162)
(2) Search for :
bool hasButtonMethods = false; var boundPaymentMethods = new List<PaymentMethod>(); var paymentMethods = PaymentMethodManager.GetAllPaymentMethods(filterByCountryId);
(3) Add your filter conditions (something like)
var filterPm = PaymentMethodManager.GetPaymentMethodById(25); // Filtred Payment method ID if (!Page.User.IsInRole("User role to filter")) // Name of the role to filter { paymentMethods.Remove(filterPm); }
(4) Compile and Run ;)
I'm working on something like the filter by country in the admin. To be more useful and less hard code ;) comming soon.