Skip to content

Conditional Payment Methods

The conditional payment methods module lets you control the availability of payment gateways based on rules.

Go to WooCommerce > Settings > Polski PRO > Conditional Payments.

ConditionDescription
Shipping methodHide/show a gateway for a specific shipping method
Cart value (min)Hide a gateway when the cart is below an amount
Cart value (max)Hide a gateway when the cart is above an amount
User roleGateway only for a specific role (e.g. wholesale)
Product categoryGateway available when the cart contains products from a category

Each rule consists of:

  • Payment gateway - which gateway the rule applies to
  • Action - hide (hide when the condition is met) or show_only (show only when met)
  • Condition type - one of the above
  • Condition value - e.g. shipping method ID, amount, role slug
GatewayActionConditionValueEffect
Cash on delivery (COD)hideShipping methodinpost_lockerHide COD for InPost lockers
Bank transfershow_onlyCart value min200Bank transfer available from 200 PLN
PayPalhideUser rolewholesaleWholesalers do not see PayPal

You can add an extra fee for a chosen payment method:

SettingDescription
EnabledActivates the fee for this gateway
Fee titleText shown in the cart
TypeFixed amount or percentage
AmountThe fee value
Min. orderFee only above an amount
Max. orderFee only below an amount
Subject to VATWhether to charge VAT on the fee
Tax classThe VAT class for the fee

The fee is automatically recalculated when the payment method changes at checkout (AJAX).

The module uses the woocommerce_available_payment_gateways filter with priority 100, and woocommerce_cart_calculate_fees for fees.