I'm searching for a way to let "trusted" business to business customers shop and checkout without payment. The other customers have to pay when checking out.
These B2B customers order now by fax or mail, receive their goods together with an invoice and pay within 30 days. It should work the same way when they order via Nopcommerce.
Is it possible to achieve this with an customer role? I could create an role "B2B" and give selected customers this role. So far so good.
Next thing would be a payment plugin that checks if the client is B2B and then skips the payment stuff. Or are there better solutions?
Next thing would be a payment plugin that checks if the client is B2B and then skips the payment stuff. Or are there better solutions?
Easiest way to achieve this is to slightly customise the PurchaseOrder payment method. Just modify the HidePaymentMethod method to hide from customers who aren't in your role:
/// <summary> /// Returns a value indicating whether payment method should be hidden during checkout /// </summary> /// <param name="cart">Shoping cart</param> /// <returns>true - hide; false - display.</returns> publicbool HidePaymentMethod(IList<ShoppingCartItem> cart) { //you can put any logic here //for example, hide this payment method if all products in the cart are downloadable //or hide this payment method if current customer is from certain country
var customer = cart.GetCustomer(); if (!Nop.Core.Domain.Customers.CustomerExtensions.IsInCustomerRole(customer, "CreditAccount", true)) returntrue;
I am looking to do the exact same thing where I need to hide the shipping and payment tabs in the checkout. The suggestions I've seen so far seem to be for those that have downloaded the nopcommerce package with source code. If anyone knows how to hide these two tabs for downloaded package with no source code, I'd really appreciate directions as I don't have any coding experience. Also, I am on 4.2 version.