woocommerce / google-listings-and-ads

Sync your store with Google to list products for free, run paid ads, and track performance straight from your store dashboard.
https://woo.com/products/google-listings-and-ads/
GNU General Public License v3.0
44 stars 21 forks source link

Negative shipping rate setting leads to false onboarding completion and failure to update free listings #2466

Open eason9487 opened 1 month ago

eason9487 commented 1 month ago

Describe the bug:

https://github.com/woocommerce/google-listings-and-ads/assets/17420811/be47a991-935a-4828-a81d-149aa34e7898

Steps to reproduce:

Onboarding

  1. Go to WooCommerce > Settings > Shipping > Shipping zones and set up a zone with negative flat rate. image
  2. Start onboarding and proceed to step 2.
    1. Add the above configured zone to the Audience setting.
    2. Select the Recommended: Automatically sync my store’s shipping settings to Google option for the shipping rates setting.
  3. Proceed to complete the onboarding. It shows an error: "Unable to complete your setup." but it still continues to finish the onboarding.
  4. After being redirected to the Product Feed page, it shows more errors. image

Update free settings

  1. Use the same setup as above.
  2. Go to edit free listings.
  3. Save changes. It shows an error: "Something went wrong while saving your changes. Please try again later."

Expected behavior:

Maybe prompt users about shipping settings that are not supported by Google Merchant Center when syncing settings.

Actual behavior:

Additional details:

Error log

Automattic\WooCommerce\GoogleListingsAndAds\API\Site\Controllers\MerchantCenter\{closure} {
  "error": {
    "code": 400,
    "message": "[services[1].rateGroups[0].singleValue] Following rates are negative: -1000000",
    "errors": [
      {
        "message": "[services[1].rateGroups[0].singleValue] Following rates are negative: -1000000",
        "domain": "global",
        "reason": "invalid"
      }
    ]
  }
}