[GOOWOO-777] Flat-rate shipping method fails to sync products to Merchant Center when WPML is inactive#3573
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
joemcgill
left a comment
There was a problem hiding this comment.
@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
left a comment
There was a problem hiding this comment.
Thanks for the updates, @jamesmorrison.
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-3650Screenshots:
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).
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)
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: