Working on a plugin…extension…some code, definitely some code

In a single week I had 3 separate tasks on Codeable all on the same general issue with WooCommerce: changing payment options for specific circumstances. While it did make each successive task a bit easier since I had already been digging around in those functions it got me thinking it may be a popular plugin.

So my plan is to put together an extension or plugin to offer some options for products so that they can have individual payment options or modify the entire carts payments options if present. For that, the function was pretty quick to find and then tweak. By looping through the cart data and checking the category values against a set category or specific item ID’s the gateways can be unset if a match is found.

However it feels messy. So I’m going to try some things and post the steps along the way with all of the code I find, tweak, fork, and use in the hopes that it helps out others and eventually turns into a releasable project. If not, at least the individual snippets will be available which do have their individual specific uses :)

Here is what I have so far:

From this topic on the WC forums:

This is built of the same premise but a bit easier since we just check country.

2 replies
  1. Devin
    Devin says:

    Holidays quickly pulled my attention elsewhere and I never ended up making much more progress. I’ll go check and see if I had any further notes in my project file for this.

Comments are closed.