payment type for customer roles

Posted: 3 years ago Quote
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?
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: 3 years ago Quote
sure this can be done.

just add some if clause in the checking out page.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
fter a nop theme? pm me for a quote.
Website: www.osshop.biz
Ajax template v1.9.1: http://13dects191.noptemplate.com/
Posted: 3 years ago Quote
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.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Stephen Kennedy
Gloucester Software Ltd.
All opinions stated and advice given are my own and do not represent the views of my employer.
Posted: 2 years ago Quote
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.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: 2 years ago Quote
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.
This post/answer is useful
1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)