When updating to WooCommerce 6.8.0 version (released 9th August) smart shipping should only apply for new sites. But ends up adding a free shipping zone on existing production sites.
opened 10:24AM - 15 Aug 22 UTC
closed 03:18AM - 17 Aug 22 UTC
focus: onboarding wizard
focus: shipping
plugin: woocommerce
focus: onboarding
### Prerequisites
- [x] I have carried out troubleshooting steps and I believ… e I have found a bug.
- [x] I have searched for similar bugs in both open and closed issues and cannot find a duplicate.
### Describe the bug
It is hard to get rid of Onboarding process "panel" in WP Dashboard. It proposed too many things (extra plugins)
But since the onboarding process is not closed, a user can still play with it but it can override / change your settings.
Adding automatically free shipping methods can lead to extra owner costs ! (in each case, all order are free of delivery costs !)
I've finally found a way with "hide" panel with the 3 dots, and i did not see again the "6/6 Start to sell".
### Expected behavior
Secure the onboarding by preventing it to override already set settings.
Check if personal methods have been already set before adding default free shipping method
Ease onboarding by proposing later on the none critical plugins
All marketing stuffs are not needed to start a store
### Actual behavior
see https://github.com/woocommerce/woocommerce/blob/e05f52b18a2054488238524afb1a7566cdfe7b9a/plugins/woocommerce/src/Internal/Admin/Homescreen.php#L128-L131
### Steps to reproduce
1 Set your own shipping methods
2. Each time you "play" with a not closed onboarding process (smart screens), a default free shipping zone is added (set on the shop country area), even if you already have set your own methods.
### WordPress Environment
Woo 6.7/6.8
### Isolating the problem
- [X] I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.
- [X] This bug happens with a default WordPress theme active, or [Storefront](https://woocommerce.com/storefront/).
- [X] I can reproduce this bug consistently using the steps above.
woocommerce:trunk
← woocommerce:fix/34319-do-not-add-smart-shipping-defaults-when-shipping-setup-exist
opened 02:53AM - 17 Aug 22 UTC
### All Submissions:
- [X] Have you followed the [WooCommerce Contributing … guideline](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md)?
- [X] Does your code follow the [WordPress' coding standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/)?
- [X] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/woocommerce/woocommerce/pulls) for the same update/change?
### Changes proposed in this Pull Request:
Closes #34319
This PR fixes smart shipping defaults bug.
As noted in the issue, we should not create a new shipping zone when there is already one.
This PR counts # of shipping zones to make sure we don't create/override a shipping zone.
### How to test the changes in this Pull Request:
1. Start with a fresh install.
2. Do not initiate OBW yet.
3. Go to `WooCommerce -> Settings -> Shiping` and create a shipping zone.
4. Complete OBW and choose a country not that is not one of the US, CA, AU, or GB.
5. Navigate to `WooCommerce -> Home`
6. Navigate to `WooCommerce -> Settings -> Shiping` and confirm no extra shipping zone exist.
7. Confirm `woocommerce_admin_created_default_shipping_zones` option has been created.
### Other information:
- [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
- [ ] Have you written new tests for your changes, as applicable?
- [ ] Have you successfully run tests with your changes locally?
- [ ] Have you created a changelog file for each project being changed, ie `pnpm changelog add --filter=<project>`?
### FOR PR REVIEWER ONLY:
- [ ] I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.
The issue was fixed in WooCommerce 6.8.1 release.
josklever
(Jos Klever)
August 17, 2022, 7:49pm
3
Hi Sebastian,
Did you find anything about if the unwanted shipping zone is automatically removed in 6.8.1 or do we need to check/clean every site?
Is this added only on websites where since 6.8.0 the OBW (OnBoarding Wizard) was run? That would drastically reduce the risk.
And do you know if we can use a code snippet to list the shipping zones for every site, so we can check all managed sites via MainWP?
I checked 3 sites manually and didn’t see an extra shipping zone, so it looks like it didn’t hit every site.
Thanks,
Jos
The PR for the fix is not very clear if the free shipping zone was conditional on anything being run from the WooCommerce setup wizard (onboarding) . Not clear if the 6.8.1 release would remove any free shipping zone that was added in error from the 6.8.0 release.
There is a WooCommerce WP-CLI command that would list out shipping zones in table format (default).
https://woocommerce.github.io/code-reference/classes/WC-Shipping-Zone-Data-Store.html
system
(system)
Closed
September 23, 2022, 6:27pm
7
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.