Skip to content

Fix Delete Site "Manage Purchases" link to navigate to site-specific purchases#108569

Draft
tx2pnw wants to merge 2 commits intotrunkfrom
fix/CHE-145-delete-site-link
Draft

Fix Delete Site "Manage Purchases" link to navigate to site-specific purchases#108569
tx2pnw wants to merge 2 commits intotrunkfrom
fix/CHE-145-delete-site-link

Conversation

@tx2pnw
Copy link
Contributor

@tx2pnw tx2pnw commented Feb 6, 2026

Fixes #CHE-145

Proposed Changes

  • Replace purchasesRoot (/me/purchases) with getPurchaseListUrlFor( siteSlug ) (/purchases/subscriptions/{siteSlug}) in the Delete Site warnings component
  • Thread siteSlug prop from the parent DeleteSite component (already available via getSelectedSiteSlug) into DeleteSiteWarnings
  • Both "Manage purchases" and "Cancel trial" buttons now link to the site-specific purchases page

Why are these changes being made?

When users with active subscriptions try to delete a site, clicking "Manage purchases" takes them to /me/purchases (all purchases across all sites). For users with multiple subscriptions, this makes it difficult to find the specific subscription they need to cancel before deleting the site.

This fix updates the link to navigate to /purchases/subscriptions/{siteSlug}, which shows only the purchases for the site being deleted. This matches the existing pattern used in the Dashboard site delete modal and the Leave Site flow.

Testing Instructions

  1. Navigate to a site with active paid subscriptions
  2. Go to Site Settings > Delete Site (/sites/settings/site/{site-slug}/delete-site)
  3. Verify the "Unable to delete site" warning appears
  4. Click "Manage purchases" button
  5. Expected: Redirect to /purchases/subscriptions/{site-slug} (site-specific purchases)
  6. Not expected: Redirect to /me/purchases (all purchases)

Also test the trial site flow:

  1. Navigate to a site with an active/expired trial
  2. Go to Site Settings > Delete Site
  3. Click "Cancel trial" button
  4. Verify redirect goes to the site-specific purchases page

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple, Atomic, and self-hosted Jetpack sites?
  • Have you checked for TypeScript, React or other console errors?
  • Have you tested accessibility (keyboard navigation, screen readers)?

@tx2pnw tx2pnw self-assigned this Feb 6, 2026
@matticbot
Copy link
Contributor

matticbot commented Feb 6, 2026

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • agents-manager
  • help-center
  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/CHE-145-delete-site-link on your sandbox.

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.

2 participants