Table of Contents
- WooCommerce Admin Updates:
- 2.1.3
- Fix a bug where the JetPack connection flow would not activate #6521
- Update target audience of business feature step #6508
- 2.1.2
- 2.1.0
- Correct the Klarna slug #6440
- Navigation: Reset submenu before making Flyout #6396
- Email notes now are turned off by default #6324
- Refactor menu item mapping and sorting #6382
- Fixed associated Order Number for refunds #6428
- Remove CES actions for adding and editing a product and editing an order #6355
- Center the activity panel #6289
- Make sure that industry is defined in payment methods #6281
- Add a new note with a link to the downloadable product doc #6277
- Onboarding - Fixed "Business Details" error #6271
- Change siteUrl to homeUrl on navigation site title #6240
- Refactor panel with withFocusOutside #6233
- Move capability checks to client #6365
- Add CES track settings tab on updating settings #6368
- Add navigation intro modal #6367
- WooCommerce Product Blocks Updates:
- WooCommerce Core Updates:
- Fix offsets not calculated correctly sometimes on select2 dropdowns (29397)
- Low stock threshold for variations(29345)
- Trigger country field change on address change click (29282)
- Fix: Product categories widget item count not always showing the correct number (29281)
- Prevent displaying coupon form on checkout requiring login (29151)
- Add/28568 dashboard widget - setup (29174)
- Avoid/minimize wc-ajax requests when geolocation_ajax is enabled (29182)
- Remove compatibility checks for major version (29200)
- Validate variation ID while adding products to the cart (29208)
- Woocommerce dashboard status widget net sales link and logic (29149)
- Prevent local relative downloadable products to be treated as "absolute" (28699)
- Checkout: phone number validation fix (27242)
- Fix invalid refund amount error when no decimals (27277)
- Only add '(optional)' to the billing_address_2 placeholder (29136)
- WooCommerce API Updates:
- Low stock threshold for variations(29345)
- Fix for issue #27553 - REST API v3 not supporting settings type order and class for settings type on shipping zone methods (29218)
- Make the refunds creation REST API behave more as documented (29099)
- Throw an error if a coupon item ID (readonly) is specified during an order update (29146)
WooCommerce 5.2 includes:
- WooCommerce Admin Updates:
- Fix a bug where the JetPack connection flow would not activate #6521
- Update target audience of business feature step #6508
- Add Guards to "Deactivate Plugin" Note Handlers #6532
- Correct the Klarna slug #6440
- Navigation: Reset submenu before making Flyout #6396
- Email notes now are turned off by default #6324
- Refactor menu item mapping and sorting #6382
- Fixed associated Order Number for refunds #6428
- Remove CES actions for adding and editing a product and editing an order #6355
- Center the activity panel #6289
- Make sure that industry is defined in payment methods #6281
- Add a new note with a link to the downloadable product doc #6277
- Onboarding - Fixed "Business Details" error #6271
- Change
siteUrl
tohomeUrl
on navigation site title #6240 - Refactor panel with withFocusOutside #6233
- Move capability checks to client #6365
- Add CES track settings tab on updating settings #6368
- Add navigation intro modal #6367
- WooCommerce Product Blocks Updates:
- WooCommerce Core Updates:
- Fix offsets not calculated correctly sometimes on select2 dropdowns
- Low stock threshold for variations
- Trigger country field change on address change click
- Fix: Product categories widget item count not always showing the correct number
- Prevent displaying coupon form on checkout requiring login
- Add/28568 dashboard widget - setup
- Avoid/minimize wc-ajax requests when
geolocation_ajax
is enabled - Remove compatibility checks for major version
- Validate variation ID while adding products to the cart
- Woocommerce dashboard status widget net sales link and logic
- Prevent local relative downloadable products to be treated as "absolute"
- Checkout: phone number validation fix
- Fix invalid refund amount error when no decimals
- Only add '(optional)' to the billing_address_2 placeholder
- WooCommerce API Updates
- Low stock threshold for variations
- Fix for issue #27553 - REST API v3 not supporting settings type
order
andclass
for settings type on shipping zone methods - Make the refunds creation REST API behave more as documented
- Throw an error if a coupon item ID (readonly) is specified during an order update
WooCommerce Admin Updates:
2.1.3
Fix a bug where the JetPack connection flow would not activate #6521
- With a fresh install of wc-admin and woocommerce, go to the home screen
- Going to the homescreen redirects to the profile setup wizard
- The first step is "Store details" choose United States (any state) for country and fill in the other details with test data.
- Click "continue", you should be taken to the "Industry" step.
- In the "Industry" step check the "Food and Drink" option only. Click "continue"
- In the "Product Type" step choose any value and click "continue"
- You should arrive at the "Business details" step which provides 2 tabs: "Business details" and "Free features". In the "Business Details" tab fill out the dropdowns with any values. Click "continue".
- In the "Free features" step expand the list of extensions to install by clicking the arrow to the right of "Add recommended business features to my site".
- Uncheck all the extensions except for "Enhance speed and security with Jetpack"
- Click "continue", the plugin will be installed and you should arrive at the theme step.
- Click "Continue with my active theme"
- After finishing the wizard, this should redirect you to the "Jetpack" setup connection flow. (You should not be redirected straight to the homescreen).
Update target audience of business feature step #6508
Scenario #1
- With a fresh install of wc-admin and woocommerce, go to the home screen, which starts the onboarding wizard
- Fill out the store details with a canadian address (addr: 4428 Blanshard, country/region: Canada -- British Columbia, city: Victoria, postcode: V8W 2H9)
- Click continue and select Fashion, apparel, and accessories, continue, and select Physical products, and continue.
- The business details tab should show a Business details tab, and a Free features tab (disabled at first)
- There should only be dropdowns visible on the Business details step (no checkboxes)
- Select 1-10 for the first dropdown, and No for the second, and click Continue.
- Click on the expansion icon for the Add recommended business features to my site
- It should list 7 features, including WooCommerce Payments (top one)
- Note down the selected features, for step 10
- Click continue, and select your theme, after it should redirect to the home screen (showing the welcome modal, you can step through this).
- The home screen task list should include a Set up WooCommerce Payments task, and there should also be a Set up additional payment providers inbox card displayed (below the task list).
- Go to Plugins > installed Plugins, check if the selected plugin features selected in step 7 are installed and activated.
Scenario #2
- With a fresh install of wc-admin and woocommerce, go to the home screen, which starts the onboarding wizard
- Fill out the store details with a spanish address (addr: C/ Benito Guinea 52, country/region: Spain -- Barcelona, city: Canet de Mar, postcode: 08360)
- Click continue and select Fashion, apparel, and accessories, continue, and select Physical products, and continue.
- On the business details tab select 1-10 for the first dropdown, and No for the second.
- After filling the dropdowns it should show several checkboxes with plugins (Facebook, mailchimp, creative mail, google ads)
- Note which ones you kept selected (you can unselect one or two)
- Click continue, and select your theme, it should show the WooCommerce Shipping & Tax step after, you can click No thanks.
- You will be redirected to the home screen, showing the welcome modal, you can step through this.
- The task list should show the Choose payment methods task, and the Set up additional payment providers inbox card should not be present.
- Click on the Choose payment methods task, it should not be displaying the Woocommerce Payments option.
- Go to Plugins > installed Plugins, check if the selected plugin features selected in step 4 are installed and activated.
2.1.2
Add Guards to "Deactivate Plugin" Note Handlers #6532
Test incompatible WooCommerce version
- Install and activate Woocommerce 4.7
- See that the Woocommerce Admin plugin is deactivated.
- Add the Deactivate Plugin note via SQL.
INSERT INTO `wp_wc_admin_notes` (`name`, `type`, `locale`, `title`, `content`, `content_data`, `status`, `source`, `date_created`, `date_reminder`, `is_snoozable`, `layout`, `image`, `is_deleted`, `icon`) VALUES ( 'wc-admin-deactivate-plugin', 'info', 'en_US', 'Deactivate old WooCommerce Admin version', 'Your current version of WooCommerce Admin is outdated and a newer version is included with WooCommerce. We recommend deactivating the plugin and using the stable version included with WooCommerce.', '{}', 'unactioned', 'woocommerce-admin', '2021-03-08 01:26:44', NULL, 0, 'plain', '', 0, 'info');
- See that the note is in the inbox
- Activate the Woocommerce Admin plugin.
- See that Woocommerce Admin immediately de-activates without a fatal error.
- See that the note remains in inbox
Test compatible WooCommerce version
- Deactivate the Woocommerce Admin plugin.
- Install and activate the latest Woocommerce version.
- Add the Deactivate Plugin note via SQL.
INSERT INTO `wp_wc_admin_notes` (`name`, `type`, `locale`, `title`, `content`, `content_data`, `status`, `source`, `date_created`, `date_reminder`, `is_snoozable`, `layout`, `image`, `is_deleted`, `icon`) VALUES ( 'wc-admin-deactivate-plugin', 'info', 'en_US', 'Deactivate old WooCommerce Admin version', 'Your current version of WooCommerce Admin is outdated and a newer version is included with WooCommerce. We recommend deactivating the plugin and using the stable version included with WooCommerce.', '{}', 'unactioned', 'woocommerce-admin', '2021-03-08 01:26:44', NULL, 0, 'plain', '', 0, 'info');
- Activate the Woocommerce Admin plugin.
- See that note is not in the inbox
- Add the Deactivate Plugin note via SQL.
INSERT INTO `wp_wc_admin_notes` (`name`, `type`, `locale`, `title`, `content`, `content_data`, `status`, `source`, `date_created`, `date_reminder`, `is_snoozable`, `layout`, `image`, `is_deleted`, `icon`) VALUES ( 'wc-admin-deactivate-plugin', 'info', 'en_US', 'Deactivate old WooCommerce Admin version', 'Your current version of WooCommerce Admin is outdated and a newer version is included with WooCommerce. We recommend deactivating the plugin and using the stable version included with WooCommerce.', '{}', 'unactioned', 'woocommerce-admin', '2021-03-08 01:26:44', NULL, 0, 'plain', '', 0, 'info');
- De-activate the Woocommerce Admin plugin.
- See that note is not in the inbox
2.1.0
Correct the Klarna slug #6440
- Set up a new store with a UK address so that Klarna available as a payment processor
- Go to the "Choose payment methods" task item
- Set up Klarna. The plugin will install.
- Click Continue. It should take you back to the payment methods page - previously it wasn't doing anything but a console error was displayed.
Navigation: Reset submenu before making Flyout #6396
- Download and activate the MailChimp plugin.
- Turn on Navigation at Settings > Advanced > Features
- Return to the WP dashboard
- Hover over WooCommerce and see the flyout menu appear
- MailChimp should not be included.
Email notes now are turned off by default #6324
- Upload the plugin and activate it.
- Update the installation date (we need a 10-day old store). You can do it with an SQL statement like this (using the WP phpMyAdmin plugin):
UPDATE `wp_options` SET `option_value`=UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 10 day)) WHERE `option_name` = 'woocommerce_admin_install_timestamp';
- Confirm that
woocommerce_merchant_email_notifications
was not set before bycore
with a SQL statement like:
DELETE FROM `wp_options` WHERE `wp_options`.`option_name` = 'woocommerce_merchant_email_notifications';
or with wp-cli:
wp option delete 'woocommerce_merchant_email_notifications';
- Run the cron job
wc_admin_daily
(this tool can help WP Crontrol).- Go to Tools > Cron Events and scroll down to the
wc_admin_daily
. - Hover over the item and click
Edit
change the Next Run toNow
and clickUpdate Event
. - It will redirect you to the cron event list, and
wc_admin_daily
should be near the top, if you wait 10 seconds and refresh the page thewc_admin_daily
should be near the bottom again, this means it has been run, and scheduled again to run tomorrow.
- Go to Tools > Cron Events and scroll down to the
- You should have not received an email note.
- Verify the note
wc-admin-add-first-product-note
was added in the DB and itsstatus
isunactioned
. You can use a statement like this:
SELECT `status` FROM `wp_wc_admin_notes` WHERE `name` = 'wc-admin-add-first-product-note';
or with wp-cli:
wp db query 'SELECT status FROM wp_wc_admin_notes WHERE name = "wc-admin-add-first-product-note"' --skip-column-names
- Run the cron again.
- The note's status should continue being
unactioned
.
Refactor menu item mapping and sorting #6382
- Enable the new navigation under WooCommerce -> Settings -> Advanced -> Features.
- Navigate to a WooCommerce page.
- Make sure all items and categories continue to work as expected.
- Activate multiple extensions that register WooCommerce extension categories. (e.g., WooCommerce Bookings and WooCommerce Payments).
- Favorite and unfavorite menu items.
- Make sure the menu item order is correct after unfavoriting.
- Create a user with permissions to see some but not all registered WooCommerce pages.
- Check that a user without permission to access a menu item cannot see said menu item.
Fixed associated Order Number for refunds #6428
- Prepare a store with refunded orders.
- Go to
Analytics
>Orders
- Set the
Date Range
filter in order to cover the refunded order date. - Verify that now the associated order number and the related products are visible.
Remove CES actions for adding and editing a product and editing an order #6355
- Add a product. The customer effort score survey should not appear (this is the toast message at the bottom left of the page).
- Edit a product. The customer effort score survey should not appear.
- Edit an order. The customer effort score survey should not appear.
Center the activity panel #6289
- Narrow your screen to <782px
- Go to WooCommerce home and orders page
- Click on 'w' button, see that the activity panel renders as expected.
Make sure that industry is defined in payment methods #6281
- Start a new store, and skip the initial onboarding flow, there is a button
Skip store details
at the bottom - Load the
Set up payments
task, the payment options should load correctly.
Add a new note with a link to the downloadable product doc #6277
- Make sure your store does not have any download products.
- Install WP Crontrol plugin.
- Add a new download product.
- Navigate to Tools -> Cron Events and run
wc_admin_daily
- Navigate to WooCommerce -> Home and confirm that the note has been added.
Onboarding - Fixed "Business Details" error #6271
- Go to the "Industry" step in the Onboarding Wizard and select
Food and drink
. - Go to the "Business Details" step and press
Free features
. - Press
Continue
. - It should work.
- Try also selecting and unselecting some checkboxes before pressing
Continue
.
Change siteUrl
to homeUrl
on navigation site title #6240
- Go to WP settings and set the home page to My account
- Go to WC settings and use the new navigation feature
- Click on the header site title My Site and see that the page direct to My account
Refactor panel with withFocusOutside #6233
- Go to WooCommerce home page
- Click on Display and Help button back and forth, check that the popover and the panel close as expected.
- Check that the setup store tab continues to work.
Move capability checks to client #6365
- Create various non-admin users with custom capabilities. Make sure to not include the
view_woocommerce_reports
for at least one role. https://wordpress.org/plugins/leira-roles/ - Log in as the non-admin users.
- Check that the correct menu items are shown.
- Check that there aren't items shown to the user they should not be able to use or interact with.
- Enable the new navigation under WooCommerce -> Settings -> Advanced -> Features.
- Check that the users are able to see the new navigation menu.
- Click on various tabs in the activity panel.
- Make sure the tabs work as expected.
- Make sure that users without the
manage_woocommerce
permission are not able to see the "Store Setup" tab. - With a user that can
manage_woocommerce
, navigate to the homepage via URL and make sure the homescreen is shown./wp-admin/admin.php?page=wc-admin
- With a user that cannot
view_woocommerce_reports
make sure navigating to an analytics report does not work./wp-admin/admin.php?page=wc-admin&path=/analytics/overview
Add CES track settings tab on updating settings #6368
- Make sure tracking is enabled in settings:
/wp-admin/admin.php?page=wc-settings&tab=advanced§ion=woocommerce_com
- Delete the option
woocommerce_ces_shown_for_actions
to make sure CES prompt triggers when updating settings. - Enable the logging of Tracks events to your browser dev console:
localStorage.setItem( 'debug', 'wc-admin:tracks' );
- Go to WooCommerce > Settings, and select a top-level tab such as Products, Shipping, etc.
- Click on
Save changes
. - Observe in developer console,
wcadmin_ces_snackbar_view
is logged when CES prompt is displayed. - In the event props, it should have a new
settings_area
key followed by the value of the settings tab you have selected.
Add navigation intro modal #6367
- Visit the homescreen and dismiss the original welcome modal if you haven't already.
- Enable the new navigation under WooCommerce -> Settings -> Advanced -> Features. (This will also require opting into tracking).
- Visit the WooCommerce Admin homescreen.
- Note the new modal.
- Check that pagination works as expected and modal styling is as expected.
- Dismiss the modal.
- Refresh the page to verify the modal does not reappear.
- On a new site, enable the navigation before visiting the homescreen.
- Navigate to the homescreen.
- Note the welcome modal is shown and the navigation intro modal is not shown.
- Refresh the page and note the nav intro modal was dismissed and never shown.
WooCommerce Product Blocks Updates:
When using the testing instructions below, test only those cases presented in the section called "Feature plugin and package inclusion in WooCommerce core". There is no need to test cases in the "Feature plugin only" section since they are not a part of WooCommerce Core.
Blocks 4.6.0
Blocks 4.7.0
WooCommerce Core Updates:
Fix offsets not calculated correctly sometimes on select2 dropdowns (29397)
- Install/activate jQuery Migrate Plugin so you can easily switch the two different jQuery versions for testing.
- Add an attributes filter widget to your shop. Use
Dropdown
as display type. - Go to the shop page and click on the Select2 dropdown and ensure the dropdown shows correctly aligned and that you can select any of the attributes listed. Select an attribute and let page reload.
- Click on the dropdown again and ensure it expands correctly and you are able to select other attributes as well.
- Do the same test with and without the admin toolbar visible. You can change this in your user settings.
- Also do the same tests (3 to 6) with the dropdown going upwards when not enough room to show on the bottom.
- Now do the same tests again (3 to 6) with using older jQuery version by changing the settings in jQuery Migrate plugin. Ensure all is looking nice.
- Also check that the dropdown is showing nicely in checkout page (country selection).
Low stock threshold for variations(29345)
- Create a variation product (P1) with at least 3 variations, set 2 variations to manage stock, one not to. Parent product set to NOT manage stock.
- Create a variation product (P2) with at least 3 variations, set 2 variations to manage stock, one not to. Parent product set to manage stock.
- Configure the store-wide low stock setting (or leave to the default 2) under
WooCommerce > Settings > Products > Inventory
. - Set the P1.V1 low stock amount to X (different to store-wide setting A), leave the P1.V2 low stock amount to no value (so that it takes the default value from store-wide setting). Set the same for P2 variations, while also setting the product P2's low stock amount to value Z.
- Set the stock above the limits for these products.
- Submit orders for the different variations and see if you observe expected behavior.
- Check that the emails are being sent at the correct stock level for each variation.
- Export both products, import them back as new products and confirm that the low stock amounts are set correctly.
- Try to set the low stock amount for all variations via the Bulk Actions dropdown.
Trigger country field change on address change click (29282)
- Add a product to the cart.
- Click
Calculate shipping
underCart totals
on the Cart page. - Change country to Bahamas. ( This will hide the postcode field )
- Click
Update
- Click on
Change address
and see that the postcode field does not render.
Fix: Product categories widget item count not always showing the correct number (29281)
- Add the Product Categories widget to your site. Enable show counts option.
- Make sure to have a hand full of products that belong to a category that is listed in that widget.
- For couple of the products, set the stock level to out of stock and save the product.
- Go back to the frontend shop page and ensure the widget shows the product count correctly.
- Go to your woocommerce->settings->products->inventory and set
Hide out of stock items from the catalog
to enabled. - Go back to the frontend shop page and ensure the widget shows the product count correctly. Should show less than in step 5 as now it suppose to hide the product from catalog if it is out of stock.
- Disable
Hide out of stock items from the catalog
setting and save. - Go back to the frontend shop page and ensure the widget shows the product count correctly.
- Test the added filter by using the code snippet
add_filter( 'woocommerce_product_recount_terms', '__return_false' );
. - Test steps 1 to 8 and observe that the count is no longer refreshed because the filter prevents the recount.
Prevent displaying coupon form on checkout requiring login (29151)
- While logged in, add a product to your cart.
- Go to WooCommerce > Settings > Accounts and Privacy.
- Change your settings to match these https://d.pr/i/cvTYw2
- Disable Allow customers to place orders without an account
- Disable Allow customers to create an account during checkout
- Log out (or open your store in a new/private browser).
- Add a product to your cart.
- Go to the checkout page and note the coupon notice isn't displayed. https://d.pr/i/wnfrD8
Add/28568 dashboard widget - setup (29174)
- Start with a fresh installation of WooCoommerce and don't start onboarding wizard yet.
- Navigate to WordPress Dashboard and confirm that you see a new widget with the title "WooCommerce Setup", but "WooCommece Status" widget is hidden.
- Confirm that the widget shows "Step 0 of 5" (the total # of steps can be 6 if you have a payment plugin available)
- Start working on onboarding tasks one by one.
- As you finish onboarding tasks, check back and confirm that step # increases.
- The "WooCommerce Setup" widget should not be displayed once you complete the onboarding tasks, but "WooCommerce Status" widget should be displayed again.
Avoid/minimize wc-ajax requests when geolocation_ajax
is enabled (29182)
Begin by setting the Default Customer Address
to "Geolocation (with Page Caching Support)" under WooCommerce > Settings > General
Start by checking out the problem:
- Set your test environment to the current version of WooCommerce (5.1)
- Open your browser's network tab, observe that with each new page load (while you move around the storefront), there is an extra
wc-ajax=get_customer_location
request. - Enter the cart and checkout pages, notice that the
wc-ajax=get_customer_location
requests don't happen on these pages.
Next:
- Checkout this branch.
- Repeat the above test; notice that the number of
wc-ajax=get_customer_location
requests has been reduced. - Add one or more items and navigate to checkout (but, no need to actually checkout).
- Change your billing country and then keep on shopping without checking out.
- Observe that the value of the
?v=
query var has changed accordingly.
🎥 Screencasts
- Current behaviour → pay attention to the large number of
wc-ajax=get_customer_location
requests. - Revised behaviour → (also shared above) notice the number of
wc-ajax=get_customer_location
requests is massively reduced, but that the?v=
query var still 'updates' if the billing country changes.
Remove compatibility checks for major version (29200)
- Start with WC 5.2 beta
- Install a plugin that triggers the old warning (such as
woocommerce-gateway-amazon-payments-advanced.1.12.2__1_.zip
) - WP Admin: Go to Plugins
- With 5.2 beta, you should see an active link saying “Enable auto-updates” on the line with WooCommerce, to the right
- WP Admin: Go to Plugins > Plugin Editor
- Select WooCommerce in the top right corner dropdown, click Select, it should show the source of woocommerce.php
- Change line 6 from * Version: 5.2.0-dev to * Version: 4.9.0, click on Update File at the bottom
- Switch to next file:
- Click on includes on the right in the column with file names, under includes, find class-woocommerce.php and click on it
- On line 26 update public $version = '5.2.0'; to public $version = '4.9.0'; , click on Update File
- Go to /wp-admin/update-core.php, select WooCommerce in the list of plugins and hit update, no more warnings should stop you from updating. WC will update to the latest version (5.1, as of now)
The checkpoints being steps 4 and 11: step 4: enable auto-updates is an active link, not greyed out step 11: no warning is displayed
Validate variation ID while adding products to the cart (29208)
Note for this test you will need to get the variable product ID. To get this ID:
- Open a variable product
- In the Product data section, click on "Variations"
- In the list, note the numbers (in this screenshot, there's 33, 26, 27, 28). These numbers are the
VARIABLE_PRODUCT_ID
- Try add to a product to the cart with
?add-to-cart=VARIABLE_PRODUCT_ID&variation_id=VARIABLE_PRODUCT_ID
so the URL should look something likehttps://mystore.com/?add-to-cart=10&variation_id=33
- Now try
?add-to-cart=VARIABLE_PRODUCT_ID&variation_id=PRODUCT_ID
- And finally
?add-to-cart=VARIABLE_PRODUCT_ID&variation_id=VARIATION_ID_FROM_ANOTHER_VARIABLE_PRODUCT
- Apply this patch and try all steps again.
Woocommerce dashboard status widget net sales link and logic (29149)
- Navigate to the WP dashboard (Dashboard > Home) and scroll down to the WooCommerce Status widget
- Click on the first row (net sales this month), it should redirect to
wp-admin/admin.php?page=wc-admin&path=%2Fanalytics%2Frevenue&chart=net_revenue&orderby=net_revenue&period=month&compare=previous_period
- Now add a product and a completed order with the product
- Make sure all the actions are completed in WooCommerce > Status > Scheduled Actions
- Go back to the dashboard WooCommerce status widget. The net sales should now show an updated number, and the little spark line on the right should match accordingly (have at-least one spike of the completed order).
- Click on the link again, and see if the displayed amount matches that of the Analytics > Revenue screen.
- Go back to the dashboard a second line should be present with the top performing product
- Click on the top seller product name, it should redirect to
wp-admin/admin.php?page=wc-admin&filter=single_product&products=PRODUCT_ID&path=%2Fanalytics%2Fproducts
where the product is selected under theshow
dropdown. - Add
add_filter( 'woocommerce_admin_disabled', '__return_true' );
to your themesfunctions.php
file. - Load the WP dashboard again
- The above buttons should now be directing to the old WooCommerce > Reports screen, it should still show the correct number in the widget.
Prevent local relative downloadable products to be treated as "absolute" (28699)
- Create a downloadable product, add files that refer to:
- absolute web address (e.g. https://woocommerce.com/wp-content/uploads/2020/02/woocommerce-payments-transactions-082020.png)
- file picked from media library
- relative file (relative to the
plugin
folder within the WordPress install. For example, WooCommerce would be installed atpublic/wp-content/plugins/woocommerce
) - file starting with two slashes // that is considered a remote absolute path
- file starting with 3 slashes that is considered a local absolute path
For example, you can use paths to files that exist on the server for the WordPress and WooCommerce install, as shown in the screenshot below:
Depending on the server install, these can generally be found in the public
or public_html
directory where WordPress is installed.
- Try to download all the files again. All should work, except for local file download via 3 slashes.
Checkout: phone number validation fix (27242)
- Add product to cart
- Go to checkout
- Fill an invalid phone number, for example insert: a123
- Submit
- The phone input is marked as invalid (red border)
Fix invalid refund amount error when no decimals (27277)
- Go to WooCommerce Settings, set Number of Decimals to 0;
- Refund an order by setting the quantity to a number > 0 and the refund amount to 0;
- Shouldn't see a browser alert message "Invalid refund amount".
Only add '(optional)' to the billing_address_2 placeholder (29136)
- Switch your test environment to the current WooCommerce version (5.1)
- Visit the checkout page and inspect the markup for Billing Address 2 field.
- Notice that
(optional)
is repeated (as part of the label text, and again within a span). - Switch to WooCommerce 5.2 beta
- Confirm that:
- The extra
(optional)
is removed from the label. - That the placeholder text still has
(optional)
at the end. - That the label remains hidden.
- The extra
WooCommerce API Updates:
Low stock threshold for variations(29345)
- Create a variation product (P1) with at least 3 variations, set 2 variations to manage stock, one not to. Parent product set to NOT manage stock.
- Create a variation product (P2) with at least 3 variations, set 2 variations to manage stock, one not to. Parent product set to manage stock.
- Set the P1.V1 low stock amount to X (different to store-wide setting A), leave the P1.V2 low stock amount to no value (so that it takes the default value from store-wide setting). Set the same for P2 variations, while also setting the product P2's low stock amount to value Z.
- Set the stock above the limits for these products.
- Check the REST API response for v2 GET requests
http://one.wordpress.test/wp-json/wc/v2/products/P1/
andhttp://one.wordpress.test/wp-json/wc/v2/products/P1/variations/V1
to check there are no changes. - Check the REST API response for v3 GET requests
http://one.wordpress.test/wp-json/wc/v3/products/P1/
andhttp://one.wordpress.test/wp-json/wc/v3/products/P1/variations/V1
and check if the correct responses get returned, including new data. - Try to update the product and variation low stock amounts using a POST request with request body such as
{ "low_stock_amount": 7 }
Fix for issue #27553 - REST API v3 not supporting settings type order
and class
for settings type on shipping zone methods (29218)
- From a fresh wp install, install WooCommerce
- Create a REST API consumer key and secret
- Add a shipping zone
- Add a flat rate shipping method under the newly added zone
- Add at least one shipping class
- Use the REST API v3 GET endpoint for shipping method zones to retrieve and check the current values (
wp-json/wc/v3/shipping/zones/*/method/*
). - Use the REST API v3 PUT endpoint for shipping method zones to update the current values (
wp-json/wc/v3/shipping/zones/*/method/*
) using payload:{ "settings": { "type": "order" } }
. Supportstype
with valueorder
orclass
- Use the same retrieve endpoint from step 6 to verify the changes.
Make the refunds creation REST API behave more as documented (29099)
- Temporarily add this at the ned of your
woocommerce.php
file, this way you won't have to bother about REST API authentication:
add_filter('woocommerce_rest_check_permissions', function() {return true;}, 10, 0 );
(note that this will cause a bunch of unit tests to fail)
-
As a shopper or in the admin area create an order for two different products, with at least two units of each. Make sure to include taxes and shipping costs.
-
Get the line items and taxes ids for the order. The easiest way is to run this in the console:
curl localhost/wp-json/wc/v3/orders/<order number> | jq --sort-keys .
(The jq
part is optional, it will just pretty-print the json; install with apt-get install jq
)
Take note of the line item ids (line_items
, shipping_lines
) and the tax ids from the received json:
{
"line_items": [
{
"id": 111,
"taxes": [
{
"id": 222,
}
]
}
],
"shipping_lines": [
{
"id": 333,
"taxes": [
{
"id": 444,
}
]
}
]
}
- Run the following to create a refund for one unit of each item, for a value of 1 on each case, including 1 for each tax (adjust the line item and tax ids as appropriate):
curl -X POST localhost/wp-json/wc/v3/orders/<order id>/refunds \
-H "Content-Type: application/json" \
-d '{
"api_refund": false,
"reason": "test",
"line_items": [
{
"id": "<line item 1 id>",
"quantity": 1,
"refund_total": 1,
"refund_tax": [
{
"id": "<tax of line item 1 id>",
"refund_total": 1
}
]
},
{
"id": "<line item 2 id>",
"quantity": 1,
"refund_total": 1,
"refund_tax": [
{
"id": "<tax of line item 2 id>",
"refund_total": 1
}
]
},
{
"id": "<shipping line item id>",
"quantity": 0,
"refund_total": 1,
"refund_tax": [
{
"id": "<tax of shipping line item id>",
"refund_total": 1
}
]
}
]}'
- Verify that the response is a json with information about the newly created refund. Load the order in admin and verify that each line item got a refund of 1 item for a value of 1, and that each tax got a refund for a value of 1 as well; also verify that the total refunded amount is correct (if you had two line items, both with taxes, and the shipping had taxes too, the total amount refunded should be 6).
Throw an error if a coupon item ID (readonly) is specified during an order update (29146)
To see the problem using the latest production code (5.0) first of all:
- Generate an order with a coupon applied.
- Via a
PUT
request, try updating the order and apply another (or the same) coupon—be sure to include anid
field for each coupon in thecoupon_lines
array. - Notice a
200 OK
response comes back but that all coupons have been removed (unexpected!) 😬
Using this changeset:
- Repeat the above.
- Notice the response is a
400 Bad Request
and that the order itself is unchanged (much clearer!) 🙂
Contribution
- Set up development environment
- Our Git Flow
- SCSS and JS minification
- Naming conventions
- CSS SASS coding guidelines and naming conventions
- Critical Flows
- API Critical Flows
- String localisation guidelines
- Translating WooCommerce
- Deprecation in core
- Adding Actions and Filters
- Common Issues
- Writing high-quality testing instructions
Release Notes
- Release Testing Instructions
- 3.6.x notes/FAQ
- 2.6.x to 3.0.0 Developer Migration Notes
- Select2 fields not working in 3.0.x
- Thumbnail Image Regeneration in 3.3+
- Customizing image sizes in 3.3+
REST API and CLI
CRUD & Data Descriptions
- Database Description
- CRUD Objects in 3.0
- Order and Order Line Item Data
- Coupon Data
- Customer Data
- Product Data
- Data Stores
Internal APIs
Theming
- Enabling product gallery features (zoom, swipe, lightbox)
- Template File Guidelines for Devs and Theme Authors
Examples / Guides
WooCommerce is an open source commerce platform built for WordPress and lovingly crafted by Automattic and the WooCommerce community 💜. Come and work with us!