Sale! Perfect rating Documented

Conditional Payment Gateways for WooCommerce

(1 customer review)

From: $19.99 / year

With Conditional Payment Gateways for WooCommerce plugin you can hide payment gateways in WooCommerce based on various conditions, for example, minimum or maximum cart amount, current date and time, current customer IP or user ID.

$19.99 Single site1 year of updates and support30-day money-back guaranteeBuy
$49.99 Unlimited sites1 year of updates and support30-day money-back guaranteeBuy
Clear

Description

With Conditional Payment Gateways for WooCommerce plugin you can hide payment gateways in WooCommerce based on various conditions, for example, minimum or maximum cart amount, current date and time, current customer IP or user ID. Plugin supports all WooCommerce payment gateways including custom gateways.

Main Features

Currently plugin includes these modules (i.e. “conditions”):

  • Required or excluded date and time – Hides WooCommerce payment gateways by current date and time.
  • Required or excluded customer IP – Hides WooCommerce payment gateways by current user IP.
  • Required or excluded user – Hides WooCommerce payment gateways by current user ID.
  • Minimum or maximum cart total – Hides WooCommerce payment gateways based on minimum and maximum cart (i.e. order) amounts.

Options

Settings are located in “WooCommerce > Settings > Conditional Payment Gateways”.

Module Options

Each module (e.g. “Cart Total”, “User”, etc.) has two settings subsections (e.g. “Minimum Cart Total” and “Maximum Cart Total”), where you can set conditions for each payment gateway. Settings may slightly differ, but generally they are similar to this:

Date and Time Module Options

or this:

Cart Total Module Options

Besides setting conditions for each payment gateway, you can also enable/disable optional additional notices here. That is, in addition to hiding a gateway, you can also add extra notice on the checkout page. For example:

Currently "%gateway_title%" is not available.

or

Minimum amount for "%gateway_title%" is %value%. Your cart total is %result%.

You can use HTML and/or shortcodes in the notice content, e.g. [alg_wc_cpg_translate].

All modules have %gateway_title% placeholder. Some modules may have additional placeholders, for example, “Cart Total” module also has %value% and %result% placeholders.

Date/Time

Hides payment gateways by current date and time. Settings are located in “WooCommerce > Settings > Conditional Payment Gateways > Date/Time”.

Options must be set as date range(s) in from-to format, i.e. dates must be separated with the hyphen - symbol.

You can add multiple date ranges, one per line (algorithm stops on first matching date range), i.e.:

from1-to1
from2-to2

Dates can be set in any format parsed by the PHP strtotime() function, except you can’t use hyphen - symbol, as it’s reserved for separating from and to values.

You can use shortcodes when setting the values.

Customer IP

Hides payment gateways by current customer IP. Settings are located in “WooCommerce > Settings > Conditional Payment Gateways > Customer IP”.

Options must be set as list of IPs, one IP per line, e.g.:

127.0.0.1
172.16.0.9
192.0.0.7

You can use shortcodes when setting the values.

User

Hides payment gateways by current user ID. Settings are located in “WooCommerce > Settings > Conditional Payment Gateways > User”.

Options must be set as list of user IDs, one per line, e.g.:

100
101
122

For guests, i.e. not logged in users, use 0.

You can use shortcodes when setting the values.

Cart Total

Set minimum and/or maximum order amounts for each payment gateway. Settings are located in “WooCommerce > Settings > Conditional Payment Gateways > Cart Total”.

If set to zero – option is ignored.

For decimal values use dot . symbol.

In “Additional notice”: %result% will output current cart total, and %value% will output current gateway min or max amount.

You can use shortcodes when setting the values.

In addition to common module options, this module has “Cart Total Calculation” option. It sets how cart total should be calculated, when checking conditions in the current module. You should use [alg_wc_cpg_cart_total] shortcode here. For example:

[alg_wc_cpg_cart_total exclude_taxes="yes" exclude_shipping="no" exclude_discounts="no"]

General Options

Conditional Payment Gateways for WooCommerce - General Options

Debug
Will add a log to “WooCommerce > Status > Logs”.
Default: no
Leave at least one gateway
Will ensure that when all payment gateways do not match “enabled” criteria, one last remaining gateway will still remain active in any case.
Default: no
Notice styling
Will be used for all additional (optional) notices. Possible values: Notice; Error; Success.
Default: Notice

Shortcodes

Plugin includes these shortcodes:

[alg_wc_cpg_if]

[alg_wc_cpg_if] shortcode can be used for the conditional output.

For example, if you need to use different min or max amounts depending on current user ID, you can add something like this to the “Cart Total” module. Let’s say you want to set min amount for user with ID 123 to $10.50, and for all other users to $15.50. In this case, you would need to set the “Minimum Cart Total” option to:

[alg_wc_cpg_if value1="{alg_wc_cpg_user_id}" value2="123" operator="equal" then="10.50" else="15.50"]

Shortcode support these attributes:

Required attributes

value1 – first value for the comparison. Can contain shortcodes – in this case you need replace square brackets [,] with curly brackets {,}, and if you need to add attributes to the shortcode, make sure you alternate double " and single ' quotes, e.g.:

[... value1="{alg_wc_cpg_cart_total exclude_taxes='no'}"...]

value2 – second value for the comparison. Can contain shortcodes – check value1 description.

operator – comparison operator. Available operators:

equal
greater_than
less_than
greater_than_or_equal
less_than_or_equal
not_equal
between
between_or_equal

When using between or between_or_equal operators, you need to set value2 attribute as comma-separated list of two values. For example, let’s say you want to disable some gateway for user with IP 172.16.0.9, but only if cart total is between $10 and $50. In this case, you would need to set “Customer IP > Exclude Customer IP > Your gateway” to:

[alg_wc_cpg_if value1="{alg_wc_cpg_cart_total}" value2="10,50" operator="between" then="172.16.0.9"]
Optional attributes

then – outputted on successful comparison. Can contain shortcodes – check value1 description.

else – outputted on failed comparison. Can contain shortcodes – check value1 description. Default value is empty string.


[alg_wc_cpg_cart_total]

[alg_wc_cpg_cart_total] shortcode calculates cart total.

Shortcode support these attributes:

exclude_taxes – should we exclude taxes when calculating cart total. Default value: yes

exclude_shipping – should we exclude shipping when calculating cart total. Default value: no

exclude_discounts – should we exclude discounts when calculating cart total. Default value: no

Example
[alg_wc_cpg_cart_total exclude_taxes="yes" exclude_shipping="no" exclude_discounts="no"]

[alg_wc_cpg_user_id]

[alg_wc_cpg_user_id] shortcode retrieves current user ID.

Shortcode has no available attributes.


[alg_wc_cpg_translate]

[alg_wc_cpg_translate] shortcode is used for WPML and Polylang translations.

[alg_wc_cpg_translate lang="EN,DE" lang_text="EN & DE text" not_lang_text="Text for other languages"]
[alg_wc_cpg_translate lang="EN,DE"]EN & DE text[/alg_wc_cpg_translate][alg_wc_cpg_translate not_lang="EN,DE"]Text for other languages[/alg_wc_cpg_translate]

1 review for Conditional Payment Gateways for WooCommerce

  1. Clemens John (verified owner)

    Plugin does it job. The Author makes outstanding support. Would definitely recommend.
    Thank you Tom!

    • Tom Anbinder

      Thank you!

Add a review

Your email address will not be published. Required fields are marked *

Changelog

2.0.1 - 26/03/2021

  • Dev - Shortcodes - [alg_wc_cpg_cart_total] - Removing and then re-adding the main filter when calling WooCommerce calculate_totals() function.
  • Dev - Admin settings restyled; descriptions updated.
  • Dev - Free plugin version released.

2.0.0 - 16/03/2021

  • Dev - "Customer IP" module added.
  • Dev - "User" module added.
  • Dev - "Date/Time" module added.
  • Dev - Cart Total - Cart total is calculated with shortcode now. Checkbox options (i.e. "Exclude taxes/shipping/discounts") removed - this is replaced by shortcode attributes now.
  • Dev - Cart Total - Additional notice - Placeholders renamed: %min_amount% and %max_amount% are now replaced by a single %value% placeholder. %result% (i.e. current cart total) placeholder added.
  • Dev - General - "Leave at least one gateway" option added.
  • Dev - General - "Debug" option added.
  • Dev - Shortcodes - [alg_wc_cpg_if] shortcode added.
  • Dev - Shortcodes - [alg_wc_cpg_cart_total] shortcode added.
  • Dev - Shortcodes - [alg_wc_cpg_user_id] shortcode added.
  • Dev - Shortcodes - [alg_wc_pgmma_translate] renamed to [alg_wc_cpg_translate].
  • Dev - Major code refactoring.
  • Plugin renamed (was "Payment Gateways Min Max Amounts for WooCommerce").
  • Tested up to: 5.7.
  • WC tested up to: 5.1.

1.1.0 - 07/11/2019

  • Fix - Cart Total - Comparing float values with epsilon now.
  • Dev - Cart Total - Option IDs for all settings updated. Min/max amounts are saved in array now.
  • Dev - Cart Total - "Exclude taxes" option added.
  • Dev - Cart Total - "Exclude discounts" option added.
  • Dev - Cart Total - Shortcodes are now processed in plugin notices on checkout. Shortcode added for WPML/Polylang translations.
  • Dev - Cart Total - Min and max notices can be displayed simultaneously now.
  • Dev - Cart Total - Admin settings restyled.
  • Dev - Cart Total - Code refactoring.
  • Plugin URI updated.
  • WC tested up to: 3.8.
  • Tested up to: 5.2.

1.0.0 - 27/04/2018

  • Initial Release.

Free version

This plugin is a premium version of free "Conditional Payment Gateways for WooCommerce" plugin.

Installation and Updates

  • Buy the plugin 🙂
  • Download plugin's zip to your computer (you will receive an email with download link, or you can always download the plugin from your account).
  • Go to "Admin Dashboard > Plugins > Add New > Upload Plugin" and browse for downloaded zip file.
  • If plugin is successfully installed - you should see it added to the Plugins list.
  • To keep WPFactory items up to date, please install WPFactory Helper plugin and enter your site key.

Refunds

We want to ensure that you are 100% happy with your purchase, so if you feel the product(s) you purchased are not the best fit for your requirements and you attempted to resolve issues with product's author, we are offering 30 day money back guarantee refund policy.