payment type for customer roles

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 年 前
Is it possible to filter the payment method based on role? Or is there another solution for my problem?

I have 2 roles. Internal & External

Internal has Purchase Order payment method only
External has Worldpay only.

Can I filter?

Also, need 1 set of pricing for internal and one for external?
14 年 前
sure this can be done.

just add some if clause in the checking out page.
13 年 前
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.
13 年 前
kingboyk wrote:
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

It will a be great feature.
13 年 前
Here is my solution ;)

(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.
10 年 前
any new updates on this, just ran into it and need this. Thanks
10 年 前
any new updates on this, just ran into it and need this. Thanks
10 年 前
If you need it now, Payment Director has Conditional payment methods
10 年 前
That's feasible!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.