---
title: How to Show Payment Methods Based on Shipping Method in WooCommerce
description: Show or hide any WooCommerce payment gateway depending on the shipping method the customer selects at checkout.
url: "https://wpfactory.com/docs/payments-by-shipping-show-by-method/"
updated: "2026-09-27"
category: How to
---

# How to Show Payment Methods Based on Shipping Method in WooCommerce

To show payment methods based on the shipping method in WooCommerce, install [Payment Gateways by Shipping Method for WooCommerce](https://wpfactory.com/item/payment-gateways-by-shipping-for-woocommerce/) and go to **WPFactory > Payment Gateways by Shipping** (also reachable at **WooCommerce > Settings > Payment Gateways by Shipping**). In each gateway's field, select the shipping methods that allow it and save. The gateway then appears only for those methods.

## Common setups

- Offer Direct bank transfer only for freight or pallet delivery.
- Allow card gateways for all methods, but PayPal only for standard shipping.
- Offer an "invoice" or custom gateway only for a courier method used by business customers.
- Hide Cash on delivery for pickup, see [disabling Cash on Delivery for local pickup](https://wpfactory.com/docs/payments-by-shipping-disable-cod-local-pickup/).

## Steps

1. Go to **WPFactory > Payment Gateways by Shipping** (also reachable at **WooCommerce > Settings > Payment Gateways by Shipping**).
2. In **General Options**, leave **Use shipping instances** unchecked to work with shipping method types, which apply across all zones. Check it and click **Save changes** if you need a rule for a specific method inside a specific zone.
3. In the **Payment Gateways** section, each gateway registered in WooCommerce is listed by its title, including gateways from other plugins.
4. For each gateway you want to limit, click its field and choose the allowed shipping methods. **Select all** and **Deselect all** help with long lists.
5. Leave gateways that should always be available empty.
6. Click **Save changes**, then test checkout with each shipping method.

![Payment Gateways section showing several gateways, one field filled, Select all and Deselect all buttons visible](https://wpfactory.com/wp-content/uploads/payments-by-shipping-show-by-method-1.png)

## How a gateway is checked at checkout

For each gateway with a non-empty field, Payment Gateways by Shipping checks the order in this order:

1. If the cart does not need shipping (for example only virtual products), the gateway stays available.
2. If no shipping method has been chosen yet, or the packages in the cart use more than one shipping method, the gateway is hidden.
3. If the chosen shipping method is in the gateway's field, the gateway stays. Otherwise it is hidden.

With method types, a selection such as Flat rate matches every Flat rate method in every shipping zone. With shipping instances, only the exact method instance you selected matches.

## Options used

| Label | Option ID | Default |
| --- | --- | --- |
| Use shipping instances | `alg_wc_pgbsm_use_shipping_instance` | No |
| (gateway title), method types | `alg_wc_pgbsm_enable_{gateway_id}` | Empty (all methods) |
| (gateway title), shipping instances | `alg_wc_pgbsm_enable_instance_{gateway_id}` | Empty (all methods) |

The full list is in the [settings reference](https://wpfactory.com/docs/payments-by-shipping-settings/).

## FAQ

### Does it work with payment gateways from other plugins?

Yes. The settings list every gateway registered in WooCommerce, so gateways added by other plugins appear with their own field.

### Can I hide a payment method for one shipping method instead of choosing the allowed ones?

Each field is an allow list. Select all shipping methods, remove the one you want to block, and save.

### Does the restriction apply to virtual products?

No. When the cart does not need shipping, gateways are not filtered by shipping method.

### Do I need to save again after turning on shipping instances?

Yes. The field option says to save changes after enabling it. The page then reloads with zone based methods, and those rules are stored separately from the method type rules.

### Get Payment Gateways by Shipping

Every feature described here is included in [Payment Gateways by Shipping](https://wpfactory.com/item/payment-gateways-by-shipping-for-woocommerce/). Set a rule once and WooCommerce checkout hides the wrong payment methods on its own.

Need a hand? Our team answers every ticket on the [Payment Gateways by Shipping support forum](https://wpfactory.com/support/item/payment-gateways-by-shipping-for-woocommerce/).

Related articles

- [How to Restrict Payment Methods by Shipping Zone in WooCommerce](https://wpfactory.com/docs/payments-by-shipping-zones/)
- [Getting Started with Payment Gateways by Shipping Method for WooCommerce](https://wpfactory.com/docs/payments-by-shipping-getting-started/)
- [Payment Gateways by Shipping Developer Reference](https://wpfactory.com/docs/payments-by-shipping-developers/)
- [Payment Gateways by Shipping Troubleshooting](https://wpfactory.com/docs/payments-by-shipping-troubleshooting/)
