Repository navigation
JOIN-147 Let a membership plan redirect to a page instead of taking payment - #124
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ment Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
conatus
left a comment
There was a problem hiding this comment.
This looks good, and obviously a lot of tests which seem to work. One comment.
| Field::make('checkbox', 'redirect_instead_of_payment', 'Redirect to a page instead of taking payment') | ||
| ->set_help_text( | ||
| 'People who choose this plan are sent to the page below instead of paying. ' . | ||
| 'They are not signed up as members. Has no effect when Donation Supporter Mode is enabled.' |
There was a problem hiding this comment.
"They are not signed up as members and not recorded in any attached CRM".
Even better if it intelligently detects the CRMs setup and provides this in context.
"They are not signed up as members and not recorded in Action Network and Mailchimp"
There was a problem hiding this comment.
Done. The help text now names whichever of Action Network, Mailchimp and Zetkin are switched on, for example "They are not signed up as members and not recorded in Action Network and Mailchimp." With none switched on it says "They are not signed up as members." Covered by unit tests and an e2e test on the settings page and in the block editor. The e2e test caught that settings can't be read until the settings container is registered, so the text is filled in at that point.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
What
A membership plan can now send people to a chosen page instead of taking payment.
Nothing is recorded for these people beyond the existing drop-off capture after the details step. They are not created in any CRM.
Why
Some organisations have a tier (for example students or a particular group) whose members should be handled outside the paid join flow, on a page the organisation chooses.
How
Settings::createMembershipPlansFieldadds the checkbox and page picker. The picker only shows once the box is ticked.Settings::getMembershipPlanRedirectUrlturns a plan's settings into a URL, or null. It only returns a URL for a published page, becauseget_page_link()on a missing page falls back to the page being viewed, which would send people back to the join form.Blocks.phppasses it to the join form as each plan'sredirectUrl.app.tsxchecks it at the plan step, usinggetPlanRedirectUrland a newredirectToPagehelper.redirectToSuccessnow reuses that helper.Tests
getMembershipPlanRedirectUrl: ticked with a page, not ticked, unticked but a page still stored, ticked with no page.getPlanRedirectUrlandredirectToPage.plan-redirect.spec.ts): only the right plan gets a redirect URL; the redirect lands on the page without a join request; coming back starts afresh; the other three plan kinds go on to payment; Supporter Mode is unaffected.admin-plan-redirect.spec.ts):E2E setup changes:
loginAsAdminhelper.Test plan
🤖 Generated with Claude Code