Checkout without payment

4 years ago
Hello Nop-folks,

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?

I'm happy with all hints and ideas ;-)
4 years ago
Kris Kilowatt wrote:
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>
public bool 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))
    return true;


  return false;
}
4 years ago
It's even easier than I expected :-)

Many thanks Pete for pointing me in the right direction!
1 week ago
Hello,

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.

Thank you!
1 week ago
@amy
Is this for all customers, or just those in particular role(s)?
1 week ago
this is for all customers.  thank you for responding!
1 week ago
Try...
Set up only one payment (e.g. CheckMoneyOrder) and shipping method (e.g. fixed rate), and then change settings to True:

paymentsettings.bypasspaymentmethodselectionifonlyone  True    
shippingsettings.bypassshippingmethodselectionifonlyone  True

(But you may have to manually mark the order as Paid.)