Toggle Payments by Category

Toggle Payments by Category lets you hide or show payment methods at checkout, based on the product categories in the cart. This guide covers installation, setting up rules and how rules work together.

Requirements

↑ Back to top
  • WordPress 6.4 or later
  • WooCommerce, active
  • PHP 7.4 or later
  • At least one payment method enabled in WooCommerce > Settings > Payments

Installation

↑ Back to top
  • Download the .zip file from your WooCommerce.com account.
  • In WordPress, go to Plugins > Add New Plugin > Upload Plugin and choose the file.
  • Click Install Now, then Activate.

Setup and configuration

↑ Back to top

Go to WooCommerce > Settings > Toggle Payments by Category. Each row of the table is one rule.

  • In Payment Gateway, choose the payment method the rule affects.
  • In Action, choose Hide or Show.
  • In Product Category, choose the category that triggers the rule.
  • Tick Incl. Subcats? if the rule should also cover the child categories of that category.
  • Click Insert Row to add another rule, or Delete Row to remove one.
  • Click Save changes.

You can also reach the settings from the Settings link under the extension name on the Plugins screen.

Hide and Show

↑ Back to top

Hide removes the payment method when at least one product from the chosen category is in the cart. Example: Hide Cash on delivery for Online Courses.

Show makes the payment method available only when at least one product from the chosen category is in the cart. When no product from that category is in the cart, the payment method is hidden. Example: Show Direct bank transfer for Furniture, with Incl. Subcats? ticked, so it also appears for products in Sofas.

How rules work together

↑ Back to top
  • Rules are checked from top to bottom. Use the up and down arrows at the start of each row to change the order.
  • If a cart contains products from several categories, every matching rule applies. A Hide rule for any of those categories hides the payment method.
  • If one payment method has several Show rules, it appears when any one of them matches.
  • A matching Show rule placed below a Hide rule for the same payment method makes it available again.
  • Products with no category, or with categories that no rule uses, do not trigger any rule.

Where the rules apply

↑ Back to top
  • The classic checkout and the block checkout
  • The Pay for order page, used when you send a customer an order to pay. The extension then reads the categories of the products in that order.
  • Express payment buttons outside the normal payment list, on the cart, checkout and product pages, for WooCommerce PayPal Payments, WooPayments, WooCommerce Stripe Payment Gateway, WooCommerce Square (digital wallets), Mollie Payments for WooCommerce, Afterpay and a few other PayPal extensions

Using it with an AI agent

↑ Back to top

On WordPress 6.9 and later, the extension registers three abilities with the WordPress Abilities API: list payment rules, add a payment rule and remove a payment rule. An AI agent connected to your site through an MCP adapter, such as Claude, ChatGPT or Cursor, can use them. Only users who can manage WooCommerce (administrators and shop managers) can run them, and every new rule is checked against your real payment methods and categories before it is saved.

Uninstalling

↑ Back to top

Deactivating the extension keeps your rules. To remove them when you delete the extension, tick Delete all plugin data on uninstall at the bottom of the settings screen and click Save changes before deleting it.

Troubleshooting

↑ Back to top
  • A payment method still shows. Check that the product is in the category used by the rule, or in a subcategory with Incl. Subcats? ticked. Then empty the cart and add the product again, and clear any page cache on the cart and checkout pages.
  • A payment method disappeared for every order. Look for a Show rule for that payment method: Show hides it whenever no product from the category is in the cart.
  • The Payment Gateway list is empty. Enable at least one payment method in WooCommerce > Settings > Payments first.

Frequently asked questions

↑ Back to top

Can I use more than one category in a rule?

Each rule uses one category. Add one row per category, or use a parent category with Incl. Subcats? ticked.

Does it change the payment methods in the WooCommerce admin when I create an order?

No. It changes what customers see at checkout and on the Pay for order page.

Is it compatible with High-Performance Order Storage (HPOS)?

Yes.

Does it slow down my store?

No. Rules are stored in a single option, the extension adds no database tables and makes no external requests.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.