Payments block: use 'purchase' copy for one-time payment plans#49550
Payments block: use 'purchase' copy for one-time payment plans#49550agent-sandbox-automattic[bot] wants to merge 1 commit into
Conversation
- utils.js: fix default plan title for one-time interval ('One-time Payment' instead of 'Subscription')
- class-jetpack-memberships.php: add is_one_time_plan() static helper
- subscriber-login.php: show 'Manage purchase' label when current post's tier is a one-time plan
Fixes MARMON-34.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 🔴 Action required: Please include detailed testing steps, explaining how to test your change, like so: 🔴 Action required: We would recommend that you add a section to the PR description to specify whether this PR includes any changes to data or privacy, like so: Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 2 files.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
Description
Fixes MARMON-34. The Payments block was using 'subscription' copy even for one-time (non-recurring) payment plans. This PR conditionally renders 'purchase' language when the plan interval is
one-time.Changes
extensions/shared/components/product-management-controls/utils.js: Changed the default plan title forone-timeinterval from'Subscription'to'One-time Payment', so new one-time plans created in the editor get a sensible default name.modules/memberships/class-jetpack-memberships.php: Addedis_one_time_plan( $plan_id )static helper that returnstruewhen a plan'sjetpack_memberships_intervalpost meta is'one-time'.extensions/blocks/subscriber-login/subscriber-login.php: Updatedrender_block()to detect the current post's tier plan interval and use'Manage purchase'as the default label (instead of'Manage subscription') when the plan is one-time. Custom block attribute labels are still respected as before.changelog/marmon-34-one-time-purchase-copy: Added patch-level changelog entry.Testing Instructions
manageSubscriptionsLabelattribute on the Subscriber Login block. Confirm the custom label is used regardless of plan type.Changelog
Linear: MARMON-34