Skip to content

[GOOWOO-777] Flat-rate shipping method fails to sync products to Merchant Center when WPML is inactive#3573

Open
jamesmorrison wants to merge 5 commits into
feature/multi-lingual-supportfrom
feature/GOOWOO-777-flat-rate-shipping-method-fails-to-sync-products-to-merchant-center
Open

[GOOWOO-777] Flat-rate shipping method fails to sync products to Merchant Center when WPML is inactive#3573
jamesmorrison wants to merge 5 commits into
feature/multi-lingual-supportfrom
feature/GOOWOO-777-flat-rate-shipping-method-fails-to-sync-products-to-merchant-center

Conversation

@jamesmorrison

@jamesmorrison jamesmorrison commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Changes proposed in this Pull Request:

Closes https://linear.app/a8c/issue/GOOWOO-777/flat-rate-shipping-method-fails-to-sync-products-to-merchant-center

Note: this started from feature/GOOWOO-772-multi-lingual-feeds-fix-feedlabel-shipping-currency-and-sync-tracking / PR-3650

Screenshots:

Detailed test instructions:

Issue 1: markets priced in a currency the plugin cannot convert no longer sync (and clean themselves up)

Setup: a store connected to a real Merchant Centre account, with WPML and WooCommerce Multilingual active and multi-currency enabled, including a currency that is not the store's default (for example EUR on a GBP store).

  1. On the Markets tab, add France as a secondary market with its currency set to EUR. Sync all products and confirm in Merchant Centre that the France entries exist under the FR-EUR feed label, and that "Shipping and returns" shows a France service in EUR.
  2. Deactivate WPML and WooCommerce Multilingual via WP Admin > Plugins.
  3. Load any admin page (this is when the plugin notices conversion is no longer available), then check Scheduled Actions: a pending "gla" update-all-products action and update-shipping-settings action should have been scheduled automatically. Run them.
  4. Expected results:
  • The sync completes with no "products failed to sync with Merchant Center" / "internal_error" entries in the logs. [Previously this setup failed the whole batch.]
  • The France entries are removed from Merchant Centre, and the France shipping service disappears from "Shipping and returns".
  • The France market is still listed on the Markets tab, untouched (nothing was deleted from the plugin's settings).
  • The primary market's products, and any secondary market priced in the store currency, sync normally throughout.
  1. Reactivate WPML and WooCommerce Multilingual (multi-currency on). Load an admin page, run the newly scheduled "gla" actions.

Expected: the France entries reappear in Merchant Centre under FR-EUR with converted prices, and the France shipping service returns.

Issue 2: Google's error codes are now recognised (retries, retry cap, and dead-entry cleanup work)

  1. Pick a product that is synced to Merchant Centre.
  2. In Merchant Centre itself, delete that product's entry directly (Products > All products > delete the entry).
  3. In WooCommerce, make the plugin try to delete the same entry: move the product to bin, or set its Google visibility to "Don't sync and show".
  4. Run the pending "gla" delete/cleanup scheduled action.

Expected: the log records "Attempted to delete product ... but it did not exist in Google Merchant Center, removing the synced product ID from database", and the plugin stops re-attempting that deletion on later runs. Previously this message never appeared and the dead entry was retried every time.

Additional details:

Fix - Fix issues with syncing (where market cannot provide price) and Google's error codes.

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.52239% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.9%. Comparing base (7328499) to head (7897db9).

Files with missing lines Patch % Lines
src/MerchantCenter/MarketService.php 90.4% 5 Missing ⚠️
...ternal/DependencyManagement/JobServiceProvider.php 0.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                        Coverage Diff                        @@
##             feature/multi-lingual-support   #3573     +/-   ##
=================================================================
+ Coverage                             69.4%   70.9%   +1.5%     
- Complexity                            6110    6145     +35     
=================================================================
  Files                                  956     542    -414     
  Lines                                30919   23922   -6997     
  Branches                              1881       0   -1881     
=================================================================
- Hits                                 21455   16962   -4493     
+ Misses                                9193    6960   -2233     
+ Partials                               271       0    -271     
Flag Coverage Δ
js-unit-tests ?
php-unit-tests 70.9% <95.5%> (+0.1%) ⬆️

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

Files with missing lines Coverage Δ
src/API/Google/Settings.php 54.5% <100.0%> (+2.5%) ⬆️
src/Google/GoogleProductService.php 75.4% <100.0%> (+10.7%) ⬆️
src/Integration/WPML.php 78.4% <100.0%> (+0.4%) ⬆️
src/Jobs/UpdateShippingSettings.php 100.0% <100.0%> (ø)
src/Product/BatchProductHelper.php 96.4% <100.0%> (ø)
.../GoogleAdapter/AbstractShippingSettingsAdapter.php 84.4% <100.0%> (+1.6%) ⬆️
...ipping/GoogleAdapter/DBShippingSettingsAdapter.php 98.1% <100.0%> (+0.1%) ⬆️
...ipping/GoogleAdapter/WCShippingSettingsAdapter.php 97.9% <100.0%> (+0.1%) ⬆️
...ternal/DependencyManagement/JobServiceProvider.php 0.0% <0.0%> (ø)
src/MerchantCenter/MarketService.php 98.2% <90.4%> (-0.8%) ⬇️

... and 414 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.

@joemcgill joemcgill left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamesmorrison I'm not familiar with the requirements this issue relates to, but it looks like an important aspect of the IB has not been implemented here, summarized by Claude:

DBShippingSettingsAdapter::create_shipping_service() (src/Shipping/GoogleAdapter/DBShippingSettingsAdapter.php) still calls get_delivery_time($country), which throws InvalidValue unconditionally when a country has a flat-rate row (ShippingRateQuery) but no matching shipping-time row (ShippingTimeQuery). That exception propagates all the way up and aborts the entire shipping settings update for every country, not just the bad one — leaving Merchant Center's shipping config stale and causing exactly the internal_error product rejections the ticket reports.

Can you review?

@joemcgill joemcgill left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates, @jamesmorrison.

Base automatically changed from feature/GOOWOO-772-multi-lingual-feeds-fix-feedlabel-shipping-currency-and-sync-tracking to feature/multi-lingual-support July 15, 2026 11:58
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