Skip to content

fix(axo): hide Fastlane when the cart contains a subscription (7156) - #4865

Merged
Dinamiko merged 6 commits into
dev/release/4.2.1from
dev/PCP-7156-fastlane-subscription-manual-renewals
Nov 4, 2026
Merged

Dinamiko merged 6 commits into
dev/release/4.2.1from
dev/PCP-7156-fastlane-subscription-manual-renewals

Conversation

@Narek13

@Narek13 Narek13 commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Problem

With "Accept manual renewals" enabled in WooCommerce Subscriptions, Fastlane is offered for carts that contain a subscription:

  • Block checkout: Fastlane is listed and selected by default, and stays on "Loading PayPal script…".
  • Classic checkout: the Fastlane gateway is listed although its scripts are not loaded.

Fastlane cannot pay for subscriptions, and the module already skips its scripts for them (AxoApplies::should_render_fastlane()). The gateway itself had no such check. Without manual renewals, WooCommerce Subscriptions removes it because it lacks subscription support; with manual renewals, it keeps every gateway. On SDK v6 the block checkout was already fine, because FastlaneConfig::should_render() drops Fastlane for subscription carts.

Fix

AxoGateway::is_available() returns false when the cart contains a subscription. The classic checkout and the block payment method (AxoBlockPaymentMethod::is_active()) both use it, so the card fields take over, as they do without manual renewals.

Verification

On DDEV, as a guest with a subscription in the cart, Fastlane enabled, manual renewals on, SDK v6 off:

Block checkout Classic checkout
Before Fastlane listed, stuck loading Fastlane listed
After PayPal, card fields PayPal, card fields, Apple Pay, Google Pay

Fastlane still shows for a cart without subscriptions. New PHPUnit tests cover availability with and without a subscription in the cart; they fail without the fix. PHPUnit: 2885 OK.

Manual test steps

  1. Enable Fastlane (US merchant) and, in WooCommerce > Settings > Subscriptions, "Accept manual renewals".
  2. As a guest, add a subscription product to the cart.
  3. Open the block checkout and a classic checkout.
  4. Expected: Fastlane is not offered; PayPal and the card fields are.
  5. With a regular product in the cart, Fastlane still shows.

Backward compatibility

No hooks, stored data or api/ functions change. Fastlane is no longer available for subscription carts when manual renewals are enabled, matching the behavior without manual renewals. No site-level data is read or written, so multisite is not affected.

Changelog Entry

Fix - Fastlane is offered for subscription carts when manual renewals are enabled

@Narek13 Narek13 changed the title fix(axo): hide Fastlane when the cart contains a subscription fix(axo): hide Fastlane when the cart contains a subscription (7156) Nov 3, 2026
@stracker-phil

Copy link
Copy Markdown
Collaborator

LGTM 👍

@Dinamiko
Dinamiko changed the base branch from dev/develop to dev/release/4.2.1 November 4, 2026 10:26
@Dinamiko
Dinamiko merged commit dbcc606 into dev/release/4.2.1 Nov 4, 2026
12 checks passed
@Dinamiko
Dinamiko deleted the dev/PCP-7156-fastlane-subscription-manual-renewals branch November 4, 2026 10:27
@InpsydeNiklas InpsydeNiklas added this to the 4.2.1 milestone Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AXO bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants