Skip to content

Surface Merchant Center setup for service-based merchants who add physical products#3298

Open
jimjasson wants to merge 4 commits intodevelopfrom
goowoo-516-surface-mc-setup-for-transitioned-service-based-merchants
Open

Surface Merchant Center setup for service-based merchants who add physical products#3298
jimjasson wants to merge 4 commits intodevelopfrom
goowoo-516-surface-mc-setup-for-transitioned-service-based-merchants

Conversation

@jimjasson
Copy link

@jimjasson jimjasson commented Mar 16, 2026

Changes proposed in this Pull Request:

This PR provides a path for service-based merchants to connect their Merchant Center account after they have set up at least 1 physical product.

Closes GOOWOO-516: Surface MC setup for transitioned service-based merchants

Specifically, a new ServiceBasedMerchantHooks class listens for product lifecycle events and resets the cached IS_SERVICE_BASED_MERCHANT option so it is recalculated on the next admin page load:

  • Product created/updated/untrashed — if the product requires shipping and the store is currently flagged as service-based, the flag is reset.
  • Product trashed/deleted — if the store is currently flagged as product-based, the flag is reset so it can be recalculated in case all physical products have been removed.

Moreover, a new ConnectMerchantCenterCard component was added in the Linked Accounts section of the Settings page.

It renders when:

  • serviceBasedMerchant is false (merchant now has physical products), and
  • MC is not yet connected

The card uses the existing MC account card appearance and links to the /google/setup-mc onboarding wizard, which will show the full MC + Ads stepper since the merchant is no longer service-based.

Once serviceBasedMerchant flips back to true (all physical products removed) or MC is connected, the card hides automatically.

Screenshots:

image

Detailed test instructions:

  1. Start on a new site with 0 products.
  2. Complete the Ads-only onboarding.
  3. Create a physical product (non-virtual, requires shipping).
  4. Navigate to Marketing -> Google for WooCommerce -> Settings.
  5. Verify the MC setup card appears in the Linked Accounts section
  6. Click "Set up Merchant Center" -> verify it navigates to the MC setup wizard.
  7. Complete setup.

Changelog entry

Add - Added an option to connect a Merchant Center account when a service-based user adds physical products.

@jimjasson jimjasson self-assigned this Mar 16, 2026
@codecov
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 96.15385% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 66.6%. Comparing base (3cdbfb7) to head (f878c2a).

Files with missing lines Patch % Lines
...ernal/DependencyManagement/CoreServiceProvider.php 0.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             develop   #3298      +/-   ##
============================================
+ Coverage       66.1%   66.6%    +0.4%     
- Complexity         0    5247    +5247     
============================================
  Files            374     890     +516     
  Lines           6115   26923   +20808     
  Branches        1551    1551              
============================================
+ Hits            4045   17922   +13877     
- Misses          1870    8801    +6931     
  Partials         200     200              
Flag Coverage Δ
js-unit-tests 66.1% <ø> (ø)
php-unit-tests 66.7% <96.2%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/Options/ServiceBasedMerchantHooks.php 100.0% <100.0%> (ø)
...ernal/DependencyManagement/CoreServiceProvider.php 0.0% <0.0%> (ø)

... and 514 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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