Merge branch 'trunk' into docs/add-a-country

This commit is contained in:
Niels Lange 2023-08-23 22:07:57 +02:00 committed by GitHub
commit 23246d49b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
112 changed files with 241 additions and 486 deletions

View File

@ -2,9 +2,11 @@
Various code snippets you can add to your site to enable custom functionality:
- [Add a message above the login / register form](./before-login--register-form.md)
- [Adjust the quantity input values](./adjust-quantity-input-values.md)
- [Add a country](./add-a-country.md)
- [Add a currency and symbol](./add-a-currency-symbol.md)
- [Change number of related products output](./number-of-products-per-row.md)
- [Add a message above the login / register form](./before-login--register-form.md)
- [Change a currency symbol](./change-a-currency-symbol.md)
- [Change number of related products output](./number-of-products-per-row.md)
- [Rename a country](./rename-a-country.md)
- [Unhook and remove WooCommerce emails](./unhook--remove-woocommerce-emails.md)

View File

@ -0,0 +1,49 @@
# Adjust the quantity input values
> This is a **Developer level** doc. If you are unfamiliar with code and resolving potential conflicts, select a [WooExpert or Developer](https://woocommerce.com/customizations/) for assistance. We are unable to provide support for customizations under our  [Support Policy](http://www.woocommerce.com/support-policy/).
Set the starting value, maximum value, minimum value, and increment amount for quantity input fields on product pages.
Add this code to your child themes `functions.php` file or via a plugin that allows custom functions to be added, such as the [Code snippets](https://wordpress.org/plugins/code-snippets/) plugin. Avoid adding custom code directly to your parent themes `functions.php` file, as this will be wiped entirely when you update the theme.
```php
if ( ! function_exists( 'YOUR_PREFIX_woocommerce_quantity_input_args' ) ) {
/**
* Adjust the quantity input values for simple products
*/
function YOUR_PREFIX_woocommerce_quantity_input_args( $args, $product ) {
// Only affect the starting value on product pages, not the cart
if ( is_singular( 'product' ) ) {
$args['input_value'] = 4;
}
$args['max_value'] = 10; // Maximum value
$args['min_value'] = 2; // Minimum value
$args['step'] = 2; // Quantity steps
return $args;
}
add_filter( 'woocommerce_quantity_input_args', 'YOUR_PREFIX_woocommerce_quantity_input_args', 10, 2 );
}
if ( ! function_exists( 'YOUR_PREFIX_woocommerce_available_variation' ) ) {
/**
* Adjust the quantity input values for variations
*/
function YOUR_PREFIX_woocommerce_available_variation( $args ) {
$args['max_qty'] = 20; // Maximum value (variations)
$args['min_qty'] = 2; // Minimum value (variations)
// Note: the starting value and step for variations is controlled
// from the 'woocommerce_quantity_input_args' filter shown above for
// simple products
return $args;
}
add_filter( 'woocommerce_available_variation', 'YOUR_PREFIX_woocommerce_available_variation' );
}
```
If you are looking for a little more power, check out our [Min/Max Quantities](http://woocommerce.com/products/minmax-quantities) extension!

View File

@ -0,0 +1,21 @@
# Rename a country
Add this code to your child themes `functions.php` file or via a plugin that allows custom functions to be added, such as the [Code Snippets](https://wordpress.org/plugins/code-snippets/) plugin. Avoid adding custom code directly to your parent themes functions.php file, as this will be wiped entirely when you update the theme.
```php
if ( ! function_exists( 'YOUR_PREFIX_rename_country' ) ) {
/**
* Rename a country
*
* @param array $countries Existing country names
* @return array $countries Updated country name(s)
*/
function YOUR_PREFIX_rename_country( $countries ) {
$countries['IE'] = __( 'Ireland (Changed)', 'YOUR-TEXTDOMAIN' );
return $countries;
}
add_filter( 'woocommerce_countries', 'YOUR_PREFIX_rename_country' );
}
```

View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Add generate slug prop to the QueryProductAttribute type

View File

@ -15,6 +15,7 @@ export type QueryProductAttribute = {
type: string;
order_by: string;
has_archives: boolean;
generate_slug: boolean;
};
type Query = {

View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Remove attribute dropdown constraint to let the users create more than one attribute with the same name

View File

@ -0,0 +1,5 @@
Significance: patch
Type: update
Comment: Update regex to not match 'product_brand'

View File

@ -28,6 +28,7 @@ import { EnhancedProductAttribute } from '../../hooks/use-product-attributes';
import { TRACKS_SOURCE } from '../../constants';
type NarrowedQueryAttribute = Pick< QueryProductAttribute, 'id' | 'name' > & {
slug?: string;
isDisabled?: boolean;
};
@ -109,9 +110,11 @@ export const AttributeInputField: React.FC< AttributeInputFieldProps > = ( {
if (
inputValue.length > 0 &&
! allItems.find(
( item ) => item.name.toLowerCase() === inputValue.toLowerCase()
)
( createNewAttributesAsGlobal ||
! allItems.find(
( item ) =>
item.name.toLowerCase() === inputValue.toLowerCase()
) )
) {
return [
...filteredItems,
@ -130,7 +133,10 @@ export const AttributeInputField: React.FC< AttributeInputFieldProps > = ( {
source: TRACKS_SOURCE,
} );
if ( createNewAttributesAsGlobal ) {
createProductAttribute( { name: attribute.name } ).then(
createProductAttribute( {
name: attribute.name,
generate_slug: true,
} ).then(
( newAttr ) => {
invalidateResolution( 'getProductAttributes' );
onChange( { ...newAttr, options: [] } );
@ -204,7 +210,7 @@ export const AttributeInputField: React.FC< AttributeInputFieldProps > = ( {
tooltipText={
item.isDisabled
? disabledAttributeMessage
: undefined
: item.slug
}
>
{ isNewAttributeListItem( item ) ? (

View File

@ -307,6 +307,7 @@ describe( 'AttributeInputField', () => {
queryByText( 'Create "Co"' )?.click();
expect( createProductAttributeMock ).toHaveBeenCalledWith( {
name: 'Co',
generate_slug: true,
} );
await waitFor( () => {
expect( invalidateResolutionMock ).toHaveBeenCalledWith(
@ -352,6 +353,7 @@ describe( 'AttributeInputField', () => {
queryByText( 'Create "Co"' )?.click();
expect( createProductAttributeMock ).toHaveBeenCalledWith( {
name: 'Co',
generate_slug: true,
} );
await waitFor( () => {
expect( createErrorNoticeMock ).toHaveBeenCalledWith(

View File

@ -18,7 +18,7 @@ export const productApiFetchMiddleware = () => {
// This is needed to ensure that we use the correct namespace for the entity data store
// without disturbing the rest_namespace outside of the product block editor.
apiFetch.use( ( options, next ) => {
const versionTwoRegex = new RegExp( '^/wp/v2/product' );
const versionTwoRegex = new RegExp( '^/wp/v2/product(?!_)' );
if (
options.path &&
versionTwoRegex.test( options?.path ) &&

View File

@ -0,0 +1,35 @@
*** WooCommerce Beta Tester Changelog ***
2022-10-11 - version 2.1.0
* Dev - Add WooCommerce Admin Helper Tester functionality to Beta Tester
2021-12-17 - version 2.0.5
* Fix - make WC version comparison case insensitive
2021-09-29 - version 2.0.4
* Dev - Bump tested to version
* Fix - enqueue logic for css/js assets
2021-09-22 - version 2.0.3
* Fix - Bump version to release version including admin.css.
2020-11-26 - version 2.0.2
* Fix - notice for undefined `item`
* Fix - auto_update_plugin filter reference
* Fix - including SSR in bug report
* Fix - style in version modal header
* Add - check for WooCommerce installed in default location
2019-03-14 - version 2.0.1
* Enhancement - Changes to make this plugin compatible with the upcoming WooCommerce 3.6
2018-07-12 - version 2.0.0
* Enhancement - Re-built to pull updates from the WordPress.org repository rather than GitHub.
* Enhancement - Channel selection; choose to receive RC or beta versions.
* Enhancement - Admin bar item shows version information, and offers shortcuts to functionality.
* Enhancement - Shortcut to log GitHub issues.
* Enhancement - Version switcher; choose which release or prerelease to switch to.
* Enhancement - Setting to enable auto-updates.
2017-06-19 - version 1.0.3
* Fix - repo URLs and directory renaming.

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: This only changes some metadata relating to the release of the beta tester.

View File

@ -1,101 +0,0 @@
=== WooCommerce Beta Tester ===
Contributors: automattic, bor0, claudiosanches, claudiulodro, kloon, mikejolley, peterfabian1000, rodrigosprimo, wpmuguru
Tags: woocommerce, woo commerce, beta, beta tester, bleeding edge, testing
Requires at least: 4.7
Tested up to: 6.0
Stable tag: 2.2.2
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Easily update to prerelease versions of WooCommerce for testing and development purposes.
== Description ==
**WooCommerce Beta Tester** allows you to try out new versions of WooCommerce before they are officially released.
**Use with caution, not on production sites. Beta releases may not be stable.**
After activation, you'll be able to choose an update channel:
1. Beta - Update to beta releases, RC, or stable, depending on what is newest.
2. Release Candidate - Update to RC releases or stable, depending on what is newest.
3. Stable - No beta updates. Default WordPress behavior.
These will surface pre-releases via automatic updates in WordPress. Updates will replace your installed version of WooCommerce.
**Note**, this will not check for updates on every admin page load unless you explicitly tell it to. You can do this by clicking the "Check Again" button from the WordPress updates screen or you can set the `WC_BETA_TESTER_FORCE_UPDATE` to true in your `wp-config.php` file.
You can get to the settings and features from your top admin bar under the name WC Beta Tester.
== Frequently Asked Questions ==
= Does this allow me to install multiple versions of WooCommerce at the same time?
No; updates will replace your currently installed version of WooCommerce. You can switch to any version from this plugin via the interface however.
= Where do updates come from? =
Updates are downloaded from the WordPress.org SVN repository where we tag prerelease versions specifically for this purpose.
= Does this rollback my data? =
This plugin does not rollback or update data on your store automatically.
Database updates are manually ran like after regular updates. If you downgrade, data will not be modified. We don't recommend using this in production.
= Where can I report bugs or contribute to WooCommerce Beta Tester? =
Bugs can be reported to the [WooCommerce Beta Tester GitHub issue tracker](https://github.com/woocommerce/woocommerce-beta-tester).
= Where can I report bugs or contribute to WooCommerce? =
Join in on our [GitHub repository](https://github.com/woocommerce/woocommerce/).
See our [contributing guidelines here](https://github.com/woocommerce/woocommerce/blob/master/.github/CONTRIBUTING.md).
== Changelog ==
= 2.1.0 2022-10-11 =
* Dev - Add WooCommerce Admin Helper Tester functionality to Beta Tester
= 2.0.5 - 2021-12-17 =
* Fix: make WC version comparison case insensitive
= 2.0.4 - 2021-09-29 =
* Dev: Bump tested to version
* Fix: enqueue logic for css/js assets
= 2.0.3 - 2021-09-22 =
* Fix: Bump version to release version including admin.css.
= 2.0.2 =
* Fix notice for undefined `item`
* Fix auto_update_plugin filter reference
* Fix including SSR in bug report
* Fix style in version modal header
* Add check for WooCommerce installed in default location
= 2.0.1 =
* Changes to make this plugin compatible with the upcoming WooCommerce 3.6
= 2.0.0 =
* Enhancement - Re-built to pull updates from the WordPress.org repository rather than GitHub.
* Enhancement - Channel selection; choose to receive RC or beta versions.
* Enhancement - Admin bar item shows version information, and offers shortcuts to functionality.
* Enhancement - Shortcut to log GitHub issues.
* Enhancement - Version switcher; choose which release or prerelease to switch to.
* Enhancement - Setting to enable auto-updates.
= 1.0.3 =
* Fix repo URLs and directory renaming.
= 1.0.2 =
* Updated API URL.
= 1.0.1 =
* Switched to releases API to get latest release, rather than tag which are not chronological.
= 1.0 =
* First release.

View File

@ -3,7 +3,7 @@
* Plugin Name: WooCommerce Beta Tester
* Plugin URI: https://github.com/woocommerce/woocommerce-beta-tester
* Description: Run bleeding edge versions of WooCommerce. This will replace your installed version of WooCommerce with the latest tagged release - use with caution, and not on production sites.
* Version: 2.2.2
* Version: 2.2.3
* Author: WooCommerce
* Author URI: http://woocommerce.com/
* Requires at least: 5.8
@ -30,7 +30,7 @@ if ( ! defined( 'WC_BETA_TESTER_FILE' ) ) {
}
if ( ! defined( 'WC_BETA_TESTER_VERSION' ) ) {
define( 'WC_BETA_TESTER_VERSION', '2.1.0' ); // WRCS: DEFINED_VERSION.
define( 'WC_BETA_TESTER_VERSION', '2.2.3' ); // WRCS: DEFINED_VERSION.
}
/**

View File

@ -1,4 +0,0 @@
Significance: minor
Type: add
Register product catalog and search visibility blocks

View File

@ -1,4 +0,0 @@
Significance: minor
Type: add
[E2E test coverage]: General tab #39411

View File

@ -1,4 +0,0 @@
Significance: minor
Type: add
[E2E test coverage]: Disable block product editor #39417

View File

@ -1,4 +0,0 @@
Significance: minor
Type: add
[E2E test coverage]: Enable new product management experience

View File

@ -1,4 +0,0 @@
Significance: minor
Type: add
Add filter for adding new user preference option for notice to user data fields.

View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Add support for slug auto generation to the create attribute endpoint

View File

@ -1,4 +0,0 @@
Significance: minor
Type: add
Register the product variation items block

View File

@ -1,4 +0,0 @@
Significance: patch
Type: add
Add plugin installation request track for core profiler

View File

@ -1,4 +0,0 @@
Significance: minor
Type: add
Add delete option to generate variations API, to auto delete unmatched variations.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: add
API for block-based templates.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: add
Added feature flag that removes store appearance task and adds customize store task when enabled

View File

@ -1,4 +0,0 @@
Significance: minor
Type: update
Added xstate scaffolding for customize your store feature

View File

@ -1,4 +0,0 @@
Significance: minor
Type: add
Add support for Japan and UAE in WooPayments

View File

@ -1,5 +0,0 @@
Significance: patch
Type: dev
Comment: Added PHPCS and fixed linting errors.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: add
Add post_password for products for REST API V3

View File

@ -1,4 +0,0 @@
Significance: minor
Type: add
Add woocommerce/product-password-field block to new product editor

View File

@ -1,4 +0,0 @@
Significance: minor
Type: add
Add block template registry and controller

View File

@ -1,4 +0,0 @@
Significance: minor
Type: update
Update WCPay banners for WooPay in eligible countries.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: update
Add 'variable' to supported post types for product block editor

View File

@ -1,4 +0,0 @@
Significance: minor
Type: dev
Runs all API tests on daily run. Skips failing tests on CI.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: dev
[Product Block Editor] Disable tabs in parent product page with variations #39459

View File

@ -1,4 +0,0 @@
Significance: minor
Type: dev
[Product Block Editor] Disable the new editor for variable products.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: dev
Added storybook for core profiler pages

View File

@ -1,4 +0,0 @@
Significance: patch
Type: dev
Fixed TS type error for state machine Context in Core Profiler that only got caught after TS5 upgrade

View File

@ -1,4 +0,0 @@
Significance: minor
Type: dev
Optimized the System Status Report unit tests.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: dev
Refactored some core profiler utils out to reuse them in customise your store.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: dev
Remove dependency on e2e-environment and e2e-utils in wc-admin.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: dev
Shard the unit tests into two test suites.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: dev
Update pnpm to 8.6.7

View File

@ -1,4 +0,0 @@
Significance: minor
Type: dev
Upgrade TypeScript to 5.1.6

View File

@ -1,4 +0,0 @@
Significance: patch
Type: dev
Remove the non-existing method from TaskList docs.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: dev
Simplify user id retrieval in analytics-overview.spec.js.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: dev
Fixes a failing e2e test in our daily test runs.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: dev
Fix flaky E2E tests in analytics-overview.spec.js.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
include post_ID in HPOS order edit screen

View File

@ -1,4 +0,0 @@
Significance: patch
Type: performance
Use direct meta calls for backfilling instead of expensive object update.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: enhancement
Create the Organization tab

View File

@ -1,4 +0,0 @@
Significance: minor
Type: enhancement
Add filter `woocommerce_pre_delete_{object_type}` which allows preventing deletion.'

View File

@ -1,4 +0,0 @@
Significance: patch
Type: tweak
Safety measures to prevent future breakages when executing bulk actions in the order list table (HPOS).

View File

@ -1,4 +0,0 @@
Significance: patch
Type: enhancement
Modify order index to also include date for faster order list query.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
Connect WC_Install's create_tables to HPOS tables when its active.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
Support inserting NULL values for strict DB mode for DataBase Util's insert_on_duplicate_key_update method.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
Store transactional data in order tables with HPOS.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
Add migration to move incorrectly stored payment token IDS to HPOS tables from postmeta.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
Fix failure due to multiple h2 tags in the Product Vendors plugin

View File

@ -1,4 +0,0 @@
Significance: minor
Type: dev
Added a unit test for plugin feature compatibility data in WC Tracker

View File

@ -1,4 +0,0 @@
Significance: minor
Type: tweak
When all plugins are deselected, but Jetpack is already installed and not connected, redirect users to the Jetpack Connect page.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: enhancement
Update the admin's menu remaining tasks bubble CSS class and handling

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
Limit index length to 191 characters by default, additionally connect HPOS to verify DB tooling.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
Bring HPOS order hooks in line with the posts implementation.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: fix
Adds display of postcodes to Vietnam addresses.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: fix
Ensure refund meta data is saved correctly when HPOS is enabled.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
include post_ID in HPOS order edit screen

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
Fix Storefront recommendation link and missing image in Marketplace

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
Prevent possible error when refreshing order edit locks.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
Prevent possible fatal error when edit lock is held on deleted order.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: fix
Be more precise when checking submission data from the email verification form on the order confirmation screen.

View File

@ -1,5 +0,0 @@
Significance: patch
Type: fix
Comment: Fixes a regression from an earlier PR in same release (39450)

View File

@ -1,4 +0,0 @@
Significance: patch
Type: tweak
Do not run 'woocommerce_process_shop_order_meta' for order post when HPOS is authoritative.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: tweak
When HPOS is authoritative, execute order update logic earlier during the request.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: fix
[Product Block Editor] remove digital products from the target list #39769

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
Onboarding payments task not completed after setting up WooPayments

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
Use admin theme color for select2, instead of hardcoded theme values.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
Use admin theme color instead of old pink. Update old pink to the new brand color.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
Fixed a race condition that was causing page views on intro-opt-in page to be sent before tracks was enabled.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: fix
Fixes WooCommerce knowledge base API returning empty posts.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
Address more PHP 8.1+ deprecation warnings in wc-admin code.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
Disable read on sync while backfilling.

View File

@ -1,5 +0,0 @@
Significance: patch
Type: dev
Comment: Improves organization of test helper code; does not merit its own changelog entry.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: fix
Always return bool values from WPCacheEngine functions when expected.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: tweak
Fix TikTok naming.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: tweak
Modified the error message shown to customers in the event that no payment gateways are available.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: fix
Ensure that the full discount is ignored in free shipping minimum order calculations when ignore_discount setting is enabled

View File

@ -1,4 +0,0 @@
Significance: minor
Type: update
add time support to product import on sale dates

View File

@ -1,4 +0,0 @@
Significance: minor
Type: update
On the order confirmation screen, show the 'thank you' message regardless of whether the viewer is verified or not.

View File

@ -1,4 +0,0 @@
Significance: patch
Type: tweak
Add loading indicator when submitting location in Tax task

View File

@ -1,4 +0,0 @@
Significance: minor
Type: update
Update task list to show a spinner on item click

View File

@ -1,5 +0,0 @@
Significance: patch
Type: tweak
Comment: This only updates the experiment name of the product block editor, this does not need to be listed in the changelog.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: update
Use the same checkbox style on the platform selctor

View File

@ -1,4 +0,0 @@
Significance: minor
Type: tweak
Center align checkbox, logo, and the title on the plugins page (core profiler)

View File

@ -1,4 +0,0 @@
Significance: minor
Type: dev
Remove unused variation option components

View File

@ -1,4 +0,0 @@
Significance: minor
Type: tweak
Run A/B test on the core profiler plugins page -- suggest Jetpack or Jetpack Boost

View File

@ -1,4 +0,0 @@
Significance: minor
Type: tweak
Remove subheading letter-spacing from the core profiler pages.

View File

@ -1,4 +0,0 @@
Significance: minor
Type: update
Updates Action Scheduler to 3.6.2 (bug fixes and improvements to help debug problems).

View File

@ -1,4 +0,0 @@
Significance: minor
Type: fix
Update CSS prop 'end' to 'flex-end' when using flexbox.

View File

@ -0,0 +1,4 @@
Significance: patch
Type: update
Turn off the experimental flag for HPOS.

Some files were not shown because too many files have changed in this diff Show More