Commit Graph

21788 Commits

Author SHA1 Message Date
Vedanshu Jain 5999ea6716
Add filter to overwrite response of `wc_rest_should_load_namespace` (#50902)
* Add filter to allow overwriting `wc_rest_should_load_namespace`.

* Unit tests + changelog.

* Add doc block.

* Update version number.

Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>

---------

Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
2024-08-30 16:42:28 +05:30
Alba Rincón 40cde50879
`Product SKU` improvements (#51033)
* Add new prefix and suffix attributes

* Add editable prefix & suffix rich text fields

* Remove the uppercase style from prefix and suffix

* Render the prefix and suffix in the front end

* Fix lint errors

* Handle old sku block without prefix and suffix

* Improve the editor styles

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Use wp_kses_post to filter and format the suffix and perfix

* Address extra space when empty and better escaping

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-30 10:23:28 +02:00
Gabriel Manussakis 0f1634d6da
[Accessibility] Trap focus inside the product gallery modal (#50730)
* Add i18n_open_product_gallery prop to wc_single_product_params

* Trap focus inside the product gallery modal

* Ensure the product gallery controls are always visible

* Add changelog file

* Add space before parameter

* Early return if there is no elements enough to trap focus

* Revert changes on the gallery trigger link

* Remove unnecessary white sopace

* Fix trap focus when the arrow buttons are hidden

* Remove usage of the Photoswipe destroy event
2024-08-30 10:14:22 +02:00
Bart Kalisz ff197207ef
Product Collection: Don't render when empty unless the no results block is present (#50404)
* Disable PC render when content empty unless no results block is present

* Introduce empty PC classname

* Add E2E test

* Add changelog entry

* Ensure the render is preserved as expected

* Do not render empty div

* Update tests

* Try a different logic

* Add hint to the docblock

* Remove obsolete e2e test

* Update render handler name to acknowledge context

* Fix tests failing due to recent v3 update

* Restore block interactivity

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2024-08-30 08:48:54 +02:00
Karol Manijak 062c4ed76a
Migrate Product Price to `block.json` (#50905)
* Migrate Product Price to block.json

* Add changelog

* Update block references

* Update block references and doc manifest

* Add shared config properties to Product Price block.json

* Update block references and docs manifest
2024-08-30 07:47:03 +02:00
Ivan Stojadinov 3a2a812e1d
[e2e tests] External sites - update /merchant tests, part 1 (#51014)
* Dismiss "Choose a pattern" if present

* Cover "New in store" for PRessable

* Handle error for `api.delete( coupons/<id> )`

* Check if `Select an option…` is available

* Expand Pressable suite

* Add changefile(s) from automation for the following project(s): woocommerce

* Missed one spec, adding it now

* Handle "Choose a pattern" popup

* Use `closeChoosePatternModal` instead

* Remove comments

* Add missing `throw` error

* Revert to check `Browse store` link, after updating template on Pressable

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-29 21:05:30 +02:00
github-actions[bot] a5e9744ed5
Delete changelog files based on PR 51001 (#51039)
Delete changelog files for 51001

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-08-30 01:04:09 +07:00
Tung Du cd638721f9
[Experimental] Update folder structure for new product filter blocks (#51029) 2024-08-29 15:23:40 +00:00
github-actions[bot] 84e689d8a4
Delete changelog files based on PR 50923 (#51036)
Delete changelog files for 50923

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-08-29 19:10:24 +07:00
RJ 88806aae87
add: stripe tax to onboarding tax task (#50989) 2024-08-29 19:48:51 +08:00
Vedanshu Jain f359c20f84
Bust WC object cache on direct postmeta updates. (#50215) 2024-08-29 08:42:26 -03:00
Corey McKrill ad94888ce3
Ensure stock change notifications only fire when necessary (#51001)
* Ensure stock change notifs only fire when necessary

In #49583 we changed when the actions that trigger stock change
notifications fire, to decouple them from order creation. However, it
turns out what during product creation, the stock quantity update
routines still run even when no stock is being set and even when the
"manage stock" setting is set to false. Rather than try to untangle the
web of why this happens (and potentially break other things in the
process), this simply adds a check for the "manage stock" setting prior
to firing the notif actions, and bail early if the product does not have
managed stock.

It also adds a unit test, which is really more of an integration test,
to ensure this behavior.

Fixes #50958

* Remove irrelevant doc block info

In #49583 we added a second parameter to the
`woocommerce_variation_set_stock` and `woocommerce_product_set_stock`
action hooks, but it was later removed. However, we didn't remove the
corresponding doc block info.

* Add changelog file

---------

Co-authored-by: Naman Malhotra <naman03malhotra@gmail.com>
2024-08-29 17:11:38 +07:00
Alba Rincón 0a1af26785
Remove extra bottom padding in filters in the editor (#51012)
* Remove filter margins in the editor

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Remove small space after + sign

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-29 10:26:11 +02:00
github-actions[bot] 260409fcad
Delete changelog files based on PR 51021 (#51032)
Delete changelog files for 51021

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-08-29 09:24:40 +01:00
Adrian Moldovan 0a3c4dde65
[tests] Execute test env setup on host instead of wp-env container (reverts #50445) (#51021) 2024-08-29 11:17:31 +03:00
Albert Juhé Lluveras 84532c8823
CYS: Fix icon alignment in header patterns used by CYS (#50952)
* Align Cart and My Account icons to the right in the Essential Header pattern

* Align navigation icon to the right in the Minimal Header pattern

* Add changelog file
2024-08-29 08:56:27 +02:00
Albert Juhé Lluveras b7c4c68598
Conditionally initialize block template compatibility classes (#50785)
* Don't initialize the block template compatibility classes in classic themes

* Conditionally initialize the block template compatibility classes when the template is being rendered

* Add changelog file

* Remove unnecessary blank line

* Conditionally initialize the block template compatibility classes when the template is being rendered (II)
2024-08-29 08:54:28 +02:00
Manish Menaria 055cf09cc1
Change cursor style of preview button to default (#50612)
* Change cursor style of preview button to default

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Hover and active state shouldn't change background color of the preview button.

* Remove use of wp-block-woocommerce-product-collection class

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-29 11:16:59 +05:30
Karol Manijak 81ebd85f9e
Migrate Product Image to `block.json` (#50903)
* Migrate Product Image to block.json

* Remove unnecessary property

* Add changelog

* Update block references

* Remove duplicated attributes

* Update block references and doc manifest
2024-08-28 19:56:27 +02:00
Lukas Kurzmann ccc5042ce9
fixes not allowed size parameter for any input types, which do not al… (#50438)
* fixes not allowed size parameter for any input types, which do not allow them

* add changelog

* Update plugins/woocommerce/templates/global/quantity-input.php

* Appease linter

---------

Co-authored-by: Lukas Kurzmann <lukas.kurzmann@sunlime.at>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Jorge Torres <jorge.torres@automattic.com>
2024-08-28 13:00:45 -03:00
Mike Jolley 0aae5fd859
[Flaky Test] Wait for cart response after applying coupons (#50996)
* Wait for cart response after applying coupons

* Add changefile(s) from automation for the following project(s): woocommerce

* Add changefile(s) from automation for the following project(s): woocommerce

* trigger CI

* Delete plugins/woocommerce/changelog/50995-fix-flaky—cart—oupon-test-50928

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-28 16:55:18 +01:00
Karol Manijak d9a47a15a9
Migrate On Sale Badge to `block.json` (#50908)
* Migrate On Sale Badge to block.json

* Add changelog

* Fix types

* Update block references

* Update block references and doc manifest
2024-08-28 16:26:21 +02:00
Gabriel Manussakis 91b6e972e3
[Accessibility] Fix misspelling in plugins/woocommerce-blocks/docs (#48562)
* Fix "overriden" typo

* Fix "prequisites" typo

* Fix "overriden" typo

* Fix "recieve" typo

* Fix "differnt" typo

* Fix "revew" typo

* Fix "resetted" typo

* Fix "overriden" typo

* Fix "overriden" typo

* Fix "Appearence" typo

* Fix "Producto" typo

* Fix "tha" and "modifed" typos

* Fix "Boundry" typo

* Fix "boths" typo

* Fix "visibile" typo

* Fix "overriden" typo

* Fix "Apperance" typo

* Fix "returing" typo

* Fix "extration" typo

* Fix "brough" typo

* Fix "teh" typo

* Fix "fileds" typo

* Fix "arry" typo

* Add changelog file

* Revert change of "Producto" word

* Revert change of "Producto" word
2024-08-28 10:00:01 -04:00
Ivan Stojadinov 98aebdfcc7
[e2e tests] External sites - update /customize-store tests (#51004)
* Skip - number of introductory patterns not same on Pressable

* Skip - "Want more patterns?" is always present, skipping for now

* Skip -  it activates theme through CLI, don't work for Pressable

* Include /customize-store folder for Pressable execution

* Update month formatting

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
2024-08-28 13:03:33 +02:00
Alex Florisca 9f79715d06
Small updates to the express checkout area (#50644) 2024-08-28 11:16:55 +01:00
Alba Rincón 1d21197f77
Hide reviews in the frontend when they are disabled at store or product level (#50979)
* Not show reviews in the frontend when they are disabled at store or product level

* Add tests for single product template

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Fix typo

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-28 10:01:55 +02:00
Corey McKrill eb868090b1
PluginUtil: Add method to get active valid plugins (2nd attempt) (#50974)
* Restore changes from 48709

* Update the PluginUtil method and related unit test

* Update API endpoint, fix schemas

* Improve unit tests for API controllers
2024-08-28 08:44:17 +02:00
Chi-Hsuan Huang 4dbc8aa74b
Refactor WooCommercePayments task to use woo payment gateway from`WC()->payment_gateways->payment_gateways()` (#50953)
* Fake woopayments gateway is_account_partially_onboarded return false

* Refactor WooCommercePayments class to use get_woo_payments_gateway() function

* Add changefile(s) from automation for the following project(s): woocommerce-beta-tester, woocommerce

* Remove changelog

* Add unit tests

* Update changelog

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-28 10:44:28 +08:00
Tomek Wytrębowicz deb76cbada
Log deprecation warnings for Query class (#50969)
Log deprecation warnings for analytic reports `Automattic\WooCommerce\Admin\API\Reports\Query` class usage.

Co-authored-by: github-actions <github-actions@github.com>
2024-08-28 01:45:04 +02:00
Jorge A. Torres bd9716a33e
Remove changelog files from 9.3 from the `changelog/` (#50998)
Remove changelog files from 9.3 from the changelog/ directory
2024-08-27 16:41:35 -03:00
Fernando Marichal 9ed5a7923b
Convert with-reviews to TS (#50890)
* Convert with-reviews to ts

* Add changelog

* Remove bind
2024-08-27 16:29:44 -03:00
Ivan Stojadinov 013cef959e
[e2e tests] External sites - update admin-* folders (#50994)
* Skip `Introduction can be dismissed`

* This part is already covered in `Introduction can be dismissed`

* Skip Analytics-related tests since there are already some numbers on Pressable website

* Include admin related tests into default-pressable test suite

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
2024-08-27 18:44:56 +02:00
Ivan Stojadinov dd79e4bf97
[e2e tests] External sites - update products/add-variable-product folder (#50942)
* Include add-variable-product/**/*.spec.js for Pressable env

* Use unique identifier for the Update button

* Add changefile(s) from automation for the following project(s): woocommerce

* Add changefile(s) from automation for the following project(s): woocommerce

* Remove @local tag

* Use getBy* instead of locator

* Use `locator( '#publishing-action' )`

* Fix lint issues

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-27 18:01:41 +02:00
Albert Juhé Lluveras e13febddac
CYS: Fix bottom margin of last patterns (#50991)
* CYS: Fix bottom margin of last patterns

* Add changelog file
2024-08-27 17:25:01 +02:00
Gabriel Manussakis 2ebbe68555
[Accessibility] Fix typos in inline documentation in woocommerce client, includes, and lib folders (#50739)
* Fix typo in inline doc in woocommerce client, includes, and lib folders

* Fix typo in comment

* Uppercase the Brazilian word

---------

Co-authored-by: Darin Kotter <darin.kotter@gmail.com>
Co-authored-by: Néstor Soriano <konamiman@konamiman.com>
2024-08-27 16:23:04 +02:00
Ivan Stojadinov 1364adb690
[e2e tests] External sites - update products/block-editor folder (#50960)
* Include products/block-editor into default-pressable set of tests

* Wait for `Block: Product attributes` before proceeding

* Add changefile(s) from automation for the following project(s): woocommerce

* Put comment on why to wait for the element

* Fix issue caught by Lint - @woocommerce/plugin-woocommerce

* Fix linting error

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-27 15:56:14 +02:00
Maikel Perez e5c6477a4e
Blocks E2E: Move register product collection tester e2e tests from product collection file to its own file (#50852)
* Move register product collection tester e2e tests from product collection file to its own file

* Add changelog file

* Remove the unstable allTextContents usage

* Remove page.waitForTimeout because it doesn't validate that the button is hidden after exactly 1 second

* Remove page.waitForTimeout from 'Should display properly in Product Catalog template' e2e test

* Let's use one parent describe per file for good practice

* Keeping the structure flat
2024-08-27 09:37:45 -04:00
Albert Juhé Lluveras 1e650d06a9
Add 'Show tab title' attribute to the Product Details block (#50884)
* Add 'Show tab title' attribute to the Product Details block

* Add tests

* Add changelog file

* Linting

* Use editor.selectBlocks() instead of block.click()
2024-08-27 15:10:49 +02:00
louwie17 f2941d76e5
Add initial product data views screen (#50981)
* Add product data views feature flag

* Add basic products app file

* Add lazy render for product app

* Only render if GB is enabled

* Add translation

* Add changelogs

* Address lint issues

* Address final lint error
2024-08-27 09:49:04 -03:00
Thomas Roberts cf042dfb0a
Update WC Blocks hooks docs to point to new WC monorepo location (#50766) 2024-08-27 13:43:41 +01:00
Ivan Stojadinov 3c12dd8abb
[e2e tests] External sites - update activate-and-setup tests (#50927)
* Disable woocommerce_calc_taxes before tests start

* TEMP: Comment on expect `#setting-error-settings_updated`

* Include activate-and-setup folder into test runs for external envs

* Update core-profiler.spec.js so it's passing on Pressable and WPCOM

* Check only active plugins

* "Total sales" is missing on one of the external sites. Trying without it.

* Remove comments

* Revert to use `#submit` locator

* Revert "#setting-error-settings_updated"

* Revert "I’m just starting my business" string - check `'` sign on CI

* Revert all strings that initially contained `'` sign

* Revert "Revert "#setting-error-settings_updated""

This reverts commit ae6b72b5c4.

* Revert "Revert "I’m just starting my business" string - check `'` sign on CI"

This reverts commit e852707e06.

* Revert "Revert all strings that initially contained `'` sign"

This reverts commit f978595303.

* Reload page and check settings state instead of verifying `#setting-error-settings_updated`

* Ensure the store is not in "Coming soon" mode before basic.spec.js

* Check if store is in "Comin soon" mode - `hasText` instead of `name`

* Remove `grepInvert: /@local/`

* WPCOM - run only `basic.spec.js`

* WPCOM - run only `basic.spec.js`

* Revert default-wpcpom/playwright.config.js

* Add changefile(s) from automation for the following project(s): woocommerce

* Introduce @skip-on-default-pressable and skip `Can connect to WooCommerce.com`

* Revert "Introduce @skip-on-default-pressable and skip `Can connect to WooCommerce.com`"

This reverts commit e38abebdd2.

* Re-enable "Go to WC Home and make sure the total sales is visible"

* Introduce @skip-on-default-pressable and skip `core-profiler.spec.js`

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-27 14:07:18 +02:00
Chi-Hsuan Huang 47ff627048
Fix site visibility badge style (#50976)
* Fix site visibility badge style

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-27 16:59:01 +08:00
Karol Manijak 5a80d5e1da
Update Block Reference and make it public doc (#50906)
* Update Block References doc

* Move the Block References to public Docs

* Change the place Block Reference is generated to

* Add changelog

* Update docs manifest file

* Update manifest
2024-08-27 09:04:15 +02:00
Chi-Hsuan Huang c63bb88e0e
Add react-powered main payments settings screen (#50825)
* Fix payment store selector type

* Add changelog

* Add react-powered payment settings main screen

* Add changelog

* Update style

* Revert changes

* Fix enable payment gateway error

* Fix wcpay install busy state

* Check if Nonce exist or not

* Fix extra payment methods

* Fix untranslated texts

* Fix lint
2024-08-27 14:30:01 +08:00
Roy Ho cc07a5f902
[Experimental] Price filter: fix range slider update (#50935)
* Price filter: fix range slider update

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Fix linting error

* Remove unneeded state setter

* Update plugins/woocommerce-blocks/assets/js/blocks/product-filter/inner-blocks/price-filter/frontend.ts

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>

* Fix linting error

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2024-08-26 19:57:01 -07:00
Naman Malhotra 4142afbc05
Update stable tag to 9.2.3 (#50965)
woorelease: Update stable tag to 9.2.3
2024-08-27 01:36:29 +07:00
Corey McKrill 70faf5bba2
Checkout: prevent error from get_value method when WC has not been properly initialized (#50692)
* Ensure WC's customer and cart props are initialized

If the customer or cart property of the main WooCommerce class is
accessed before the `woocommerce_init` action has fired, those
properties will be `null` instead of containing their respective
classes, which can cause a fatal error if you then try to access a
method on one of the classes. This makes sure the props will always
return a class.

Fixes #50245

* Revert "Ensure WC's customer and cart props are initialized"

This approach unexpectedly breaks a lot of things...

This reverts commit 310fd2c118.

* Alternate solution

The attempt to fix the problem wholistically ended up causing a lot of
things to break, so this is the band-aid approach instead.

* Add changelog file

* Remove unnecessary assignment to global POST var

This was polluting the results of the new test, causing it to fail.
2024-08-26 08:17:36 -07:00
Chi-Hsuan Huang 30ae60b273
Fix flaky remote logging PHP unit test (#50950)
* Fix flaky remote logging test_remote_logging_allowed() test

* Fix Undefined variable $enabled

* Add changelog
2024-08-26 20:57:03 +08:00
Ilyas Foo 99c1980b94
Show payments recommendation on settings payment main page (#50947)
* Show payments recommendation when main settings element is found

* Changelog

* Revert to old logic instead
2024-08-26 20:18:48 +08:00
Albert Juhé Lluveras 08f724b8d8
Improve the tabs focus style in the Product Details block with Minimal style variation (#50880)
* Improve the tabs focus style in the Product Details block with Minimal style variation

* Add changelog file

* Remove direct child selector
2024-08-26 13:18:28 +02:00
Ilyas Foo b4322595c5
Hide payments recommendation when no extensions are available (#50949)
* Hide payment recommendations when no extensions are available

* Changelog
2024-08-26 16:53:05 +08:00
Alba Rincón 9e40710482
CYS - Remove usage of `prepare_item_for_response` function in `Images` endpoint (#50923)
* Remove usage of `prepare_item_for_response` function

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-26 09:58:54 +02:00
Albert Juhé Lluveras e6b1cac49c
Update compatibility layer logic so it detects blocks inside patterns (#50595)
* Detect Legacy Template block when it's inside a pattern

* Detect Single Product blocks when they are inside a pattern

* Typo

* Remove empty error messages

* Fix wrong variable passed to parse_blocks()

* Remove unnecessary parameters

* Add tests to check if the Single Product template contents are updated when the Legacy Template is in the content

* Add changelog file

* Linting

* Typo

* Make sure the correct template is used when deciding whether to disable the compatibility layer or not

* Simplify code

* Remove duplicate content in tests

* Simplify single product slug logic

* Add an extra test to make sure Single Product template logic doesn't leak into other templates

* Linting

---------

Co-authored-by: Sam Seay <samueljseay@gmail.com>
2024-08-26 09:46:32 +02:00
Tomek Wytrębowicz 53be5776f4
Remove the usage of `<ReportSummary isRequesting>` as it has no effect (#50751)
The support for such property was removed in woocommerce/woocommerce-admin#4858 ~4 years ago.

Co-authored-by: github-actions <github-actions@github.com>
2024-08-25 19:56:59 +02:00
Gabriel Manussakis 50e7a85821
[Accessibility] Remove title attribute from images in product gallery (#50886)
* Remove title attribute from images in product gallery

* Remove wp-post-image class from image selector

* Scope the image locator to the link

* Add changelog file

* Move image params filter out of wp_get_attachment_image call

* Add docblock to the woocommerce_gallery_image_html_attachment_image_params filter

* Remove unnecessary empty space
2024-08-23 12:37:45 -07:00
Mike Jolley 6c4a26770d
Order confirmation: Update mobile order summary styling so items appear side by side (#50722)
* Update order confirmation wording

* Style order details inline

* Changelog

* Update test due to change of text
2024-08-23 19:22:59 +01:00
Gabriel Manussakis d773bb483a
[Accessibility] Focus coupon input if it has an error (#48738)
* Focus cupon input if it has errors

* Add changelog file

* Add styles to coupon field with error on cart page

* Make coupon errors accessible on the cart page

* Add styles to coupon field with error on checkout page

* Rename coupon variables on cart

* Focus coupon field with error before updating live region on cart page

* Focus coupon field with error before updating live region on checkout page

* Remove incorrect early return

* Update coupon error notice test

* Improve coupon error message semantics

* Fix coupon errors for block based themes

* Update tests to not look for coupon errors on the notice block

* Rename coupon-error-message to coupon-error-notice

* Fix notice if coupon doesn't exist on tests

* FIx invalid coupon notice on classic theme test

* Update test for coupon inline notice

* Fix code formatting

Co-authored-by: Darin Kotter <darin.kotter@gmail.com>

* Fix code formatting

Co-authored-by: Darin Kotter <darin.kotter@gmail.com>

* Fix code formatting

Co-authored-by: Darin Kotter <darin.kotter@gmail.com>

* Fix code formatting

Co-authored-by: Darin Kotter <darin.kotter@gmail.com>

* Don't clear coupon input if code doesn't exist

* Create coupon error notice mixin

* Update coupon error notice styles

* Coupon error notice T19 compatibility

* Coupon error notice T17 compatibility

* Coupon error notice TT1 compatibility

* Coupon error notice TT compatibility

* Coupon error notice TT2 compatibility

* Coupon error notice TT3 compatibility

* Add spaces around paramenters

Co-authored-by: Darin Kotter <darin.kotter@gmail.com>

* Add spaces around paramenters

Co-authored-by: Darin Kotter <darin.kotter@gmail.com>

* Replace $red SCSS variable with a CSS one

* Keep input with the invalid coupon code after notice appears

* Fix typo in comment

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Fix typo in comment

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Break notice message into two lines

* Break if statement into two lines

---------

Co-authored-by: Darin Kotter <darin.kotter@gmail.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2024-08-23 19:22:28 +01:00
Caleb Mazalevskis b4fd419f74
Fix typos. (#50047) 2024-08-23 18:26:09 +01:00
Seghir Nadir e66ccf698c
Run Checkout block coupon filter on empty array (#50876)
* Run Checkout block coupon filter on empty array

* fix conditional

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* remove useless eslint skip

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-23 15:34:57 +00:00
github-actions[bot] db8890bbb0
Delete changelog files based on PR 50892 (#50912)
Delete changelog files for 50892

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2024-08-23 10:57:26 -03:00
Maikel Perez c09e45a391
Blocks E2E: Move collections e2e tests from product collection file to its own file (#50853)
* Move collections e2e tests from product collection file to its own file

* Add changelog file
2024-08-23 09:26:38 -04:00
Karol Manijak 2f68f9265b
Fix most of lint warnings (#50869)
* Fix number of lint warnings

* Add changelog

* Improve mocking value

* Fix exports

* Fix mock

* Bring back the empty array hook dependency
2024-08-23 14:30:14 +02:00
Alba Rincón 257762b564
Fix restoring product prices on bulk edit (#50836)
* Set the regular price when the `Change to:` price is left empty

* Avoid fatal error when price is empty

* Add changefile(s) from automation for the following project(s): woocommerce

* Add e2e test

* Fix lint errors

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-23 13:28:11 +02:00
Alba Rincón 091141218e
CYS - Move the `private/patterns` endpoint to woocommerce admin API (#50400)
* CYS - Move the ai/store-title endpoint to woocommerce admin api

* Add middleware and callback

* Add changefile(s) from automation for the following project(s): woocommerce

* Fix lint error

* CYS - Move the ai/business-description endpoint to woocommerce admin API

* CYS - Move the ai/store-info endpoint to woocommerce admin API

* Update endpoint

* CYS - Move the ai/images endpoint to woocommerce admin API

* CYS - Move the `ai/patterns` endpoint to woocommerce admin API

* CYS - Move the `ai/product` endpoint to woocommerce admin API

* CYS - Move the `ai/products` endpoint to woocommerce admin API

* CYS - Move the `private/patterns` endpoint to woocommerce admin API

* Remove unnecessary variable

* Replace endpoint

* Add changefile(s) from automation for the following project(s): woocommerce

* Fix lint errors

* Fix some feedback

* Refactor route to return an error not an exception and add tests

* Fix lint errors

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-23 13:27:57 +02:00
Seghir Nadir eef4749d97
Ensure translation is loaded for new shared file in Checkout Block (#50892)
* Ensure translation is loaded for new shared file

* add other files

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-23 12:37:33 +02:00
Mike Jolley 42cdc0e978
Block Checkout: Respect default saved payment method when using tokens (#50481)
* activeSavedToken state is unused

* Select is_default saved token by default

* changelog

* Unused objectHasProp
2024-08-23 12:03:11 +02:00
Jorge A. Torres ae6c278e53
Cherry-pick PR#50881 into trunk (#50897)
* Revert "PluginUtil: Add method to get active valid plugins (#48709)"

This reverts commit 4d68cd486e.

* Reintroduce get_all_active_valid_plugins public function after revert (#50885)

Retroduce get_all_active_valid_plugins public function after revert

---------

Co-authored-by: Naman Malhotra <naman03malhotra@gmail.com>
2024-08-22 20:06:49 -03:00
Jorge A. Torres 06f441fde6
Cherry-pick PR#50854 into trunk (#50896)
* Revert "Drop Select2 in Backwards compatable manner (#48731)"

This reverts commit 8f98a2a057.

* Fix linting issue

---------

Co-authored-by: Naman Malhotra <naman03malhotra@gmail.com>
2024-08-22 20:05:55 -03:00
Jorge A. Torres ff0a2c7ced
Bump stable tag after 9.2.2 (#50895)
Update stable tag
2024-08-22 18:52:16 -03:00
Maikel Perez a779788a93
Blocks E2E: Move the inspector controls e2e tests from product collection file to its own file (#50849)
* Move the inspector controls e2e tests from product collection file to its own file

* Add changelog file
2024-08-22 10:55:20 -04:00
Roy Ho 320c165cb8
Add additional size units to product image element (#50770)
* Add additional size units to product image element

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-22 06:32:03 -07:00
github-actions[bot] 7ba0fb4fde
Prep trunk for 9.4 cycle (#50859)
Prep trunk for 9.4 cycle with version bump to 9.4.0-dev

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-08-22 09:47:25 -03:00
piinthecloud 1bf6b6e44a
fix lint rule (#50843)
* fix lint rule

* add manifest

* add changelog
2024-08-22 14:25:57 +02:00
Albert Juhé Lluveras 2c0d9e0622
Store API: Add test coverage for Product Reviews endpoint (#50639)
* Store API: Add test coverage for Product Reviews endpoint

* Add changelog file

* Use assertSame() instead of assertEquals()

* Linting

* Fix category_id param test
2024-08-22 13:47:41 +02:00
Praveen 2853488410
Conditionally set new order email sent meta field (#50858)
* Add conditional logic to set email sent metafield

* Add changelog file for fix being submitted
2024-08-22 13:29:34 +05:30
Alba Rincón ae6f7837b2
CYS - Move the `ai/products` endpoint to woocommerce admin API (#50396)
* CYS - Move the ai/store-title endpoint to woocommerce admin api

* Add middleware and callback

* Add changefile(s) from automation for the following project(s): woocommerce

* Fix lint error

* CYS - Move the ai/business-description endpoint to woocommerce admin API

* CYS - Move the ai/store-info endpoint to woocommerce admin API

* Update endpoint

* CYS - Move the ai/images endpoint to woocommerce admin API

* CYS - Move the `ai/patterns` endpoint to woocommerce admin API

* CYS - Move the `ai/product` endpoint to woocommerce admin API

* CYS - Move the `ai/products` endpoint to woocommerce admin API

* Add changefile(s) from automation for the following project(s): woocommerce

* Add changefile(s) from automation for the following project(s): woocommerce-beta-tester, woocommerce

* Add changefile(s) from automation for the following project(s): woocommerce

* Fix merge issues

* Add strict types

* Start extending from AIEndpoint

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-22 09:47:03 +02:00
Chi-Hsuan Huang 0a60c3c5ec
Add e2e tests to confirm that the store is in coming soon mode after completing the core profiler (#50784)
* Update core profiler setup e2e to handle coming soon mode

This adds a new test to confirm that the store is in coming soon mode after completing the core profiler. Additionally, it adds a new test to confirm that the store is in coming soon mode after skipping the core profiler.

These changes are necessary to ensure that the core profiler setup works correctly when the store is in coming soon mode.

* Add changefile(s) from automation for the following project(s): woocommerce

* Include coming soon test case in core profiler steps

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-22 11:34:23 +08:00
Chi-Hsuan Huang b04f535a54
[Beta tester] Add fake WooPayments completion tool (#50699)
* Add woocommerce beta tester fake wcpay tool

* Add changelog
2024-08-22 10:27:35 +08:00
Ilyas Foo 8b62cf87e1
Improve reset password check using or locator (#50823)
* Update to use or locator

* Changelog
2024-08-22 08:57:46 +08:00
Sam Seay 35cdc6dc20
Use syncpack to lock pnpm version till we can fix issues (#50828) 2024-08-22 12:34:42 +12:00
Lucas fa6ea00b3c
Use stricter text selector on test (#50848)
* Use stricter text selector

Removes text ambiguity to avoid errors like "Strict mode violation resolved to 2 elements". For instance, it might search for "Settings", and there might be a menu "Foo Settings" which would resolve to 2 elements. This changes the behavior to match the exact test, instead of a substring.

* Update page-loads.spec.js

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-21 13:25:27 -07:00
Tomek Wytrębowicz 63f96eb5a8
Mark props with defaults as not required (#50816) 2024-08-21 21:59:42 +02:00
Adrian Moldovan e1e628ccf0
[e2e tests] Fix flaky navigation to editor (#50841) 2024-08-21 22:18:20 +03:00
Tomek Wytrębowicz d31aae633a
Move `ReportError` to `@woocommerce/components` as `AnalyticsError` (#50108)
Co-authored-by: Eason <eason.su.tw@gmail.com>
2024-08-21 20:12:13 +02:00
Tomek Wytrębowicz 536807ca43
Fix optional param in PHPdoc for WC_Admin_Marketplace_Promotions (#50732)
Co-authored-by: github-actions <github-actions@github.com>
2024-08-21 20:11:16 +02:00
Jorge A. Torres b798b261b3
Update stable tag to 9.2.1 (#50850)
woorelease: Update stable tag to 9.2.1
2024-08-21 15:10:28 -03:00
Corey McKrill b430971093
Avoid fatal in `wc_get_chosen_shipping_method_ids` (#50774)
This ensures the WC() session object is initialized before attempting to
get chosen shipping methods. If it's not initialized,
`wc_get_chosen_shipping_method_ids` will return an empty array.

Fixes #50283
2024-08-21 10:28:54 -07:00
Tomek Wytrębowicz 0322426dce
Reduce duplicated code in Analytics classes (#49425)
- Add code docs to the Analytics classes and make get_order_statuses non-internal.
   Document analytics classes and some methods. Add simple examples of how to use it. Give a brief "why?" and "when?" answers. Add links between related classes.
- Replace `Automattic\WooCommerce\Admin\API\Reports\*\Query` classes with a single `GenericQuery` class.
- Reduce the amount of duplicated code in Analytics `DataStore`s.
- Reduce duplicated code in Analytics controllers
- Add `FilteredGetDataTrait`, `OrderAwareControllerTrait`, and `StatsDataStoreTrait` for extension developers to reuse while creating custom Analytics
- Add a `GenericQuery` to reduce duplicated code in Query classes.
   Also, to expose it to community extensions for reuse.
- Use `GenericQuery` instead of duplicated `Query` classes
- Move caching code to shared `DataStore::get_data`
- Move intervals specific `initialize_queries` to shared Trait
- Move intervals checking logic to shared `StatsDataStoreTrait`
- Reuse `GenericController::prepare_item_for_response` for `Reports\Controller` subclasses
- Reuse `GenericController::get_collection_params` for `Reports\Controller` subclasses.
- Move `get_items` code to shared `GenericStatsController`
- Move shared paginable controllers `get_items` code to the generic class
- Move fields param to `GenericStatsController`
- Separate `OrderAwareControllerTrait` from `ReportController`
   to allow specific Analytics Controllers to extend the `Generic(Stats)Controller` directly, without extending the `ReportController`, which is used to list reports.


It's meant not to change any behavior. However, due to unification, it did tweak a few things mostly from the developer perspective:
- Previously, only some controllers threw an error from `get_items` when the data was missing; some did not. Now controllers the following Controllers changed behavior to also for such an error:
	- Coupons
	- Customers
	- Downloads
	- Orders
	- Products
	- Taxes
- the error has one error code from all controllers:`woocommerce_rest_reports_invalid_response` (previously there were report-specific)
   - `woocommerce_rest_reports_categories_invalid_response` -> `woocommerce_rest_reports_invalid_response`
- In Orders Controller, the `$orders_data['order_number'], $orders_data['total_formatted']` are set in the `prepare_item_for_response` method, not in the `get_items`So `prepare_item_for_response` function is expected to be called with bare data from Query
- In Products Controller extended-info is now sanitized in the `prepare_item_for_response` method, not in the `get_items`
- ⚠️ (breaking) Previosly some Controlers' `prepare_item_for_response` function was getting and expecting first argument to be casted to `object`, while the rest of controllers used data as returned from the Store. This PR unifies this behavior  for
   -  `Coupons\Stats\Controller`
   -  `Taxes\Controller`
   -  `Taxes\Stats\Controller`
   So, if you extend those classes and override `prepare_item_for_response` in a way that expects `object`, you will get an error. (I have not found such cases in the `all-plugins` repo.)
   All `woocommerce_rest_prepare_report_*` filters remain intact and inconsistent for backward compatibility.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Mik <mikkamp@users.noreply.github.com>
2024-08-21 19:23:51 +02:00
Adrian Duffell c738aeed17
Update site visibility badge height to 18px (#50792)
* Update badge height to 18px

* Add changelog
2024-08-22 00:23:40 +08:00
Adrian Moldovan cb9912bcf4
[e2e test] Fix strict mode violation in delete variation test (#50838) 2024-08-21 08:57:48 -07:00
piinthecloud 7dd2f11805
Docs/check payment method support (#50845)
* Fixed minor issues with recently added snippets docs

Fixed a few duplicate titles and encoding issues in the docs that were recently added via public resources.

* Create docs-check_payment_method_support

* update manifest

* fix linter errors

---------

Co-authored-by: Yaku <15178758+jacoswan@users.noreply.github.com>
2024-08-21 11:56:26 -04:00
Alba Rincón 796854770c
CYS - Move the `ai/product` endpoint to woocommerce admin API (#50393)
* CYS - Move the ai/store-title endpoint to woocommerce admin api

* Add middleware and callback

* Add changefile(s) from automation for the following project(s): woocommerce

* Fix lint error

* CYS - Move the ai/business-description endpoint to woocommerce admin API

* CYS - Move the ai/store-info endpoint to woocommerce admin API

* Update endpoint

* CYS - Move the ai/images endpoint to woocommerce admin API

* CYS - Move the `ai/patterns` endpoint to woocommerce admin API

* CYS - Move the `ai/product` endpoint to woocommerce admin API

* Add changefile(s) from automation for the following project(s): woocommerce

* Remove import

* Add changefile(s) from automation for the following project(s): woocommerce-beta-tester, woocommerce

* Add changefile(s) from automation for the following project(s): woocommerce

* Add strict types

* Extract AI_CONTENT_GENERATED constant

* Move instance creating to where it's used

* Add try/catch and fix the on Patterns

* Use the base AIEndpoint class

* Fix endpoint

* Update comment return type

* Fix comments

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-21 15:34:12 +02:00
Roy Ho 944d9233ed
Add/clear theme info cache (#50803)
* Add function to clear system status theme info cache to tool page

* Add clear cache tooltip to the template override section

* Add changefile(s) from automation for the following project(s): woocommerce

* Remove extra td

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-21 06:21:14 -07:00
DAnn2012 5690850e47
Fix typo (class-wc-tests-customizing-product-catalog.php) (#50336)
* Update class-wc-tests-customizing-product-catalog.php

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
2024-08-21 17:39:39 +05:30
Ilyas Foo 20a6327637
Add CSS outline for keyboard accessibility (#50794)
* Add CSS outline for keyboard accessibility

* Changelog
2024-08-21 18:47:33 +08:00
Adrian Duffell e45b59b71f
Update the link color in legal disclaimers on core profiler (#50830)
* Revert t&c link colors in core profiler

* Add changelog
2024-08-21 17:11:07 +08:00
Ilyas Foo 64dcafe29b
Vertically center product meta box elements (#50826)
* Vertically center product meta elements

* Changelog
2024-08-21 14:42:59 +08:00
Gabriel Manussakis b449ca840f
[Accessibility] Announce notice messages after page loads (#50061)
* Update makup of add to cart success message

* Update CSS to position the add to cart success message content

* Focus notice message after page loads

* Add changelog file

* Remove tabindex attribute from add-to-cart success message

* Update tests for the add-to-cart success message

* Remove white space on test

* Increase delay before focusing the error message

* Cobine delay with queue method

* Remove unnecessary woocommerce-notice-content class

* Swap view cart link order in notice

* Remove woocommerce-notice-content wrapper

* Refactor to vanilla JS code that focus on notice message

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2024-08-21 11:54:58 +05:30
Akeda Bagus 9ef1b72fc1
Set timeout to 2 seconds for helper product-usage-notice-rules endpoint request (#50821) 2024-08-21 11:47:40 +07:00
Moon dac8fa8eba
Coming soon mode - Match shop page when permalink structure is set to plain (#50567)
* Match shop page when permalink structure is set to plain

* Revert uninteded change

* Match post types

* Check for param

* Add test for post_type check

* Fix tests

* Add changefile(s) from automation for the following project(s): woocommerce

* Use wp_parse_url

* Test returning false

* Lint fixes

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-20 19:50:00 -07:00