Posted on 6 Comments

Collecting Donations with WooCommerce

I have been experimenting with using WooCommerce to set up a site to collect donations, on both a one-time and recurring basis.

Here is a screenshot of the finished product work in progress:



I’ve set this up with a number of WooCommerce’s paid extensions. I’ll start with the essentials, then tell you about the optional bits.



Step One: The Basics

Step one is to have your WordPress site set up, and install WooCommerce, as well as the other plugins I listed above.


Step Two: Subscriptions Settings

In your site admin area, visit your WooCommerce > Settings > Subscriptions. You can set most of this up to suit your preference, but I made three specific changes:

I changed both the Add to Cart button text and the Place Order button text to Donate Now.

Also, I set it to Allow Switching Between Subscription Variations. This means that our donors will be able to log into their account anytime, and increase or decrease the amount of their ongoing donations.


Step Three: Product Setup

Set up the donation product as a Variable Subscription. You will do this in your site admin, Products > Add Product.

You will choose Variable Subscription from the Product Type dropdown.



Step Four: Attributes

Add Attributes, for “Amount” and “Frequency.” Be sure to check “Used for variations.”



Step Five: Variations

Set up the variations. I set up for four amounts: $10, $20, $100, or name your price, on a one-time, monthly, or annual basis.



At this point, you will have to toggle open each of these Variations, and configure the details. For example, for the $20 Monthly Variation:



And for the Name Your Price Option:



The one-off donations are a little more tricky! For these, you are going to set up a subscription for every day, but with a subscription length of only 1 day. We tweak this a bit later in the process, so hang in there if this doesn’t sound quite right, so far.



Lastly, I visited the Swatches tab, and set the attributes to both display as Radio Buttons:



Step Six: Tweaking!

Now, after you have worked your way through and configured each and every one of the Variations, we are getting closer to the finished product. But there are some bits, which I have outlined in blue below, that still aren’t quite right:


I removed the From: $10.00 by adding this custom snippet to my child theme’s function.php:



Then, I changed the goofy wording of “every day for 1 day” with a pair of snippets. This targeted the “every day for 1 day” but also awkward wording that turned up with the other options.



I also used Loco Translate to change a string of text in WooCommerce Subscriptions, from First renewal: %s to Next: %s, so it looked a bit cleaner in the cart and at checkout.

Additionally, since we don’t sell any other items on this site, I didn’t use a shop page, and I redirected all shop links to the single product page, with this filter:


More steps:

From here, you are pretty much good to go. You will need to setup and configure your compatible payment gateway, and of course, test the system to make sure it is working as you like.

Stripe has a very easy way to set up test credentials, meaning you can do as many transactions as you like, before turning this loose on your donors.



There are a few extra things I did here. I used Gravity Forms, and WooCommerce Gravity Forms Add Ons to set up that Note on the product, to allow the donor to purchase it in someone else’s honour, and arrange a gift card.

I also used WooCommerce PDF Invoices, and customized the template, to automatically attach a charitable tax receipt to each Order Completed email.

WooCommerce Order Status Control brings it all together, fully automating the system, by moving the order Status to Complete upon successful payment (triggering the receipt email).


Future Plans:

This isn’t  yet a perfect solution – there’s room for improvement and further cusotmization. For example, the Thank You page for a one-time donation still refers to “your subscription”, and so does the email. Next step: customize that!

6 thoughts on “Collecting Donations with WooCommerce

  1. This … is amazing!

    Thank you, I’m going to implement this on a non-profit site I’m helping someone with. Figured there was a nice WooCommerce way to do it. Thanks for outlining everything like this!

    It also inspires me to write up some of the tricky things I do with WooCommerce for other people to learn from. (Side bonus is that it’s also nice for myself when I’m delving into code after a year or more to figure out just what in the hell I was doing!)


    1. Hi John,

      Happy this helped!

      And happy to hear you are considering documenting your ideas more often. I’ve learned so much over the years from others, and that “giving back” is one of my favourite parts of the WordPress community.


  2. Greetings from Turkey!

    Ever since PayPal is no longer working in Turkey, there’s a limitation of payment processors that can be used in this country. We have identified one that is compatible with WooCommerce, but nothing else that doesn’t require a developer that doesn’t cost a fortune for a small organization like us!

    I’ll be using this (minus subscription for now) as a workaround to meet our needs.


    1. Hi Lynda!

      Sorry to hear there’s nothing compatible!

      You could set up Subscriptions but manual renewal – but the donor would have to visit to make payment each time. Not the best solution, for sure!

  3. Cool thank you!
    Did you get the emails tweaked?

    1. I did! Not a whole bunch, but a bit. And I added a PDF attachment to the email to serve as an official tax receipt.

Leave a Reply

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