DOCS

WooCommerce donation products

> Requires: Fundations Pro, WooCommerce

The WooCommerce integration links donations to WooCommerce orders and lets fundraisers display products (merchandise, event tickets, add-ons) alongside their donation form. Donors select products and complete a single checkout through WooCommerce.

Why use this

Some fundraising campaigns include physical rewards, event entries, or merchandise. Handling these through a separate WooCommerce flow disconnects the donation from the fulfillment. This integration keeps them together: one checkout, one order, one confirmation.

What it does

Two Pro blocks

get-fund/product-selector displays WooCommerce products that are enabled for the current fundation. Donors can set quantities before proceeding to checkout. The block reads the ?fund_action= URL parameter or falls back to the current post ID.

get-fund/checkout-button is a button that links to the configured WooCommerce checkout page with ?fund_action={post_id} appended. It only renders on get_fund_action singular pages and shows a demo placeholder in the block editor.

Product configuration

Each WooCommerce product gains a Fundations Donation tab in the product data section. You configure whether the product appears on fundation checkout pages, and optionally restrict it to specific fundations.

Two-phase order creation

When a donor submits a donation that includes WooCommerce products:

  1. Phase 1 (pending): When the donation status changes to pending, a WooCommerce order is created in pending status. This is skipped if an order already exists for this donation.
  2. Phase 2 (completion): When the donation is completed, the existing WC order is completed via payment_complete(). If Phase 1 was skipped (for example in test mode), a new completed order is created directly.

Leads-mode donations (zero-amount) leave the WC order in pending status for manual fulfillment.

WooCommerce customer emails are suppressed for all fund-created orders. Fundations sends its own donation confirmation email, which includes a product summary table.

How to use it

Enable a product for donation checkout

  1. Go to Products in WooCommerce.
  2. Open a product to edit.
  3. Scroll to the Product data section and click the Fundations Donation tab.
  4. Check Enable for Fundations Checkout.
  5. Optionally check Specific Fundations and select which fundations this product should appear on. If no fundations are selected here, the product appears on all fundations.
  6. Save the product.
Woocommerce product fundations tab

Add the Product Selector to a fundation page template

  1. Open your fundation page template in the block editor.
  2. Add the Product Selector block (get-fund/product-selector) where you want products to appear.
  3. Save the template.

Add the Checkout Button

  1. Add the Checkout Button block (get-fund/checkout-button) to the fundation page template.
  2. The button appears on the frontend and links to the WooCommerce checkout with the fundation pre-selected.

Configure the checkout page

The checkout page ID is stored in the option get_fund_fundations_checkout_page_id. This is normally configured during Fundations setup. If the button links to the wrong page, check this option under Fundations → Settings.

Settings & options

Per-product settings (Fundations Donation tab)

SettingDescription
Enable for Fundations CheckoutShow this product on fundation checkout pages
Specific FundationsRestrict to selected fundation post IDs. If enabled but empty, shows on all fundations

Label options (global)

Option keyDefault labelDescription
get_fund_totals_products_labelProductsLabel for the products section in totals
get_fund_totals_donation_labelDonationLabel for the donation line in totals
get_fund_totals_total_labelTotalLabel for the total line
get_fund_totals_products_total_labelProducts TotalLabel for the products subtotal

Meta keys on donations

Meta keyTypeDescription
_get_donation_wc_order_idintegerID of the linked WooCommerce order
_get_donation_productsarrayProducts data: [{id, quantity}]

Meta keys on WooCommerce orders

Meta keyTypeDescription
_get_fund_donation_idintegerLinked Fundations donation post ID
_get_fund_action_idintegerLinked fundation post ID

What you can and cannot do

  • You can link multiple products to a donation.
  • You can restrict products to specific fundations or make them available site-wide.
  • You can customise the label strings for totals display.
  • WooCommerce customer emails are disabled for fund-created orders. You cannot re-enable them without removing the woocommerce_email_enabled_* filters.
  • The Product Selector block only renders on get_fund_action singular pages. It does not work on archive pages.
  • Recurring donations with WooCommerce products are not supported. Recurring is gated by GET_FUND_RECURRING_ENABLED, which is currently false.

Examples

Event registration with a donation.

  1. Create a WooCommerce product “Event Entry” priced at 0 or a fixed amount.
  2. Enable it for Fundations Checkout.
  3. Add the Product Selector to the fundation page template.
  4. Donors select the event entry quantity alongside their donation.

Merchandise add-on.

  1. Create products for t-shirts, tote bags, etc.
  2. Enable each for Fundations Checkout and restrict to specific campaign fundations.
  3. Add the Product Selector to the campaign fundation template.

Troubleshooting

The Product Selector block shows no products. Confirm at least one WooCommerce product has the Fundations Donation tab enabled. If you enabled “Specific Fundations”, confirm the current fundation is in the selected list.

Orders are not being created. Check that WooCommerce is installed and active. The integration loads only when class_exists('WooCommerce') is true. Also confirm the donation is reaching a pending or completed status, which is when order creation is triggered.

The WooCommerce order confirmation email is not sent. This is intentional. WC emails are disabled for all fund-created orders. The donor receives a Fundations donation confirmation email instead, which includes a product summary.

The checkout button links to the wrong page. Check the option get_fund_fundations_checkout_page_id in the database or under Fundations settings and confirm it points to the correct WooCommerce checkout page.

Donation is complete but the WC order is still pending. This can happen if Phase 1 ran but Phase 2 (get_fund_donation_completed action) was not fired. Check the donation status and confirm the payment gateway fires the completion hook. Review Sync Logging for any errors in the donation lifecycle.

Developer reference

Filters

// Modify WooCommerce product data before adding to an order
// Fires during both Phase 1 and Phase 2 order creation
add_filter( 'get_fund_wc_product_data', function( $products, $donation_id, $action_id ) {
    // $products: array of [ 'id' => int, 'quantity' => int ]
    return $products;
}, 10, 3 );
// @since 1.1.0

Actions

// Fires after a WooCommerce order is created for a donation (both phases)
add_action( 'get_fund_wc_order_created', function( $wc_order_id, $donation_id ) {
    // Use to add custom order meta or send notifications
}, 10, 2 );

Donation lifecycle hooks consumed

The WooCommerce integration binds to:

HookPurpose
get_fund_donation_status_transitionPhase 1: create pending WC order when status moves to pending
get_fund_donation_completedPhase 2: complete the WC order when donation is paid

Admin UI additions

  • A WooCommerce tab is added to the Fundations donation meta box (via get_fund_meta_box_tabs and get_fund_meta_box_content filters).
  • A Fundations Donation Order meta box is added to WooCommerce order edit pages (HPOS-compatible).
  • An Order column is added to the get_fund_donation post list showing the linked WC order number.