Skip to content

Fix donation amounts not showing on confirmation page#97

Open
flintfromthebasement wants to merge 1 commit intostrangerstudios:devfrom
flintfromthebasement:fix/donation-amount-confirmation-page
Open

Fix donation amounts not showing on confirmation page#97
flintfromthebasement wants to merge 1 commit intostrangerstudios:devfrom
flintfromthebasement:fix/donation-amount-confirmation-page

Conversation

@flintfromthebasement
Copy link
Copy Markdown

@flintfromthebasement flintfromthebasement commented Mar 30, 2026

Summary

Fix

Hooks pmpro_is_level_free in the donations plugin to return false when:

  1. The level has donations enabled, AND
  2. The current $pmpro_invoice has a non-zero total

Zero-total orders on donation levels are still treated as free (no false positives).

Test plan

  • Create a donations-only level (base price $0)
  • Complete a checkout with a donation amount (e.g. $50)
  • Verify the confirmation page shows the invoice section with "Membership Cost" and "Donation" line items
  • Verify the standalone invoice/orders page still shows donation amounts
  • Verify a level with donations enabled but a non-zero base price still works correctly
  • Verify the confirmation email still includes the donation amount

🤖 Generated with Claude Code

For donations-only levels, the base level has initial_payment of 0,
so pmpro_isLevelFree() returns true. The confirmation page template
skips loading the invoice section for "free" levels, which means
the pmpro_invoice_bullets_bottom hook never fires and the donation
amount breakdown is never displayed.

This hooks into pmpro_is_level_free to return false when:
1. The level has donations enabled, AND
2. The current invoice has a non-zero total

Zero-total orders on donation levels are still treated as free.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant