Commit Graph

22274 Commits

Author SHA1 Message Date
louwie17 4601416da2
Fix/51435 product collection flaky e2e test (#51663)
* Add a couple checks so the test doesn't move ahead to quickly

* Add changelog

* Remove visible condition
2024-09-26 12:03:06 -03:00
And Finally 729ad1780a
Change aspect ratio of images in theme cards in in-app marketplace (#51705)
* We are now using 16:9 images for themes in the in-app marketplace, so we need to change the image ratio.

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-26 14:55:09 +01:00
Adrian Moldovan 645832da4b
[e2e tests] Remove basic-setup.spec.js (#51707)
Co-authored-by: Ivan Stojadinov <ivan.stojadinov@automattic.com>
2024-09-26 12:23:49 +00:00
Veljko V. 9b91256654
[e2e] External - Unskip analytics-data test on external sites (#51681)
Unskip analytics data test on external sites
2024-09-26 14:09:46 +02:00
Adrian Moldovan 294255b274
[e2e tests] Tag e2e tests that need to be reviewed (#51287) 2024-09-26 13:57:22 +02:00
Adrian Moldovan d9c42fbd27
[e2e tests] Remove test: can make sure WooCommerce is activated (#51706) 2024-09-26 14:57:07 +03:00
Albert Juhé Lluveras 97a0fc02ec
Add theme type to System Status Report (#51682)
* Add theme type to System Status Report

* Add changelog file

* Update tests

* Linting
2024-09-26 08:55:08 -03:00
Cem Ünalan 58434b8769
Marketplace: hide subscriptions with maxed connections and fix "not connected" badge (#51610)
* In-App Marketplace: hide subscriptions for maxed out connections

If we don't add this check, subscriptions with no connection allowances,
still show up in the "Available to Use" table. This can be misleading.

* In-App Marketplace: Fix My Subscriptions table row statuses

When there are multiple subscriptions for a product, we can't manage the
state between "installed" and "available to use". This commit separates
some of the functionality between the tables in the My Subscriptions
page.

1) Don't show "not connected" badge on the "available to use" table
2) Don't show the "update" button on the "available to use" table

We can't test the number two, because I noticed we no longer send the
verison number in the WCCOM endpoint

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

* Marketplace: remove unused useEffect

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-26 11:37:44 +00:00
Veljko V. 15f29b2ace
[e2e] External - Make themes util compatible with external envs and unskip relevant tests (#51509)
* Make themes util compatible with ext env and unskip relevant tests

* Add theme activation in test helper apis and update util

* Fix whitespace lint issue

* Make the util compatible with local and external envs

* Rename to activate theme

* Add theme name empty check

* Simplify theme util and update relevant tests

* Remove only from the test

* Add missing brackets to the shopper test

* Include error handling to see failure on  CI

* Include themes installation in the test setup

* Revert and refact util helper
2024-09-26 10:00:31 +02:00
louwie17 97620e2743
Add WooCommerce blocks to live storybook (#51679)
* Fix WooCommerce Blocks storybook

* Add blocks storybook to main storybook

* Add post build for iframe.html

* Only add WooCommerce Blocks when building storybook

* Use manager file again and add blocks build for storybook build

* Add changelog
2024-09-26 04:10:37 -03:00
louwie17 64c583fd73
Add missing wp block woocommerce classname (#51617)
* Update CatalogSorting classname to include wp-block class

* Add wp-block class name to the product button block

* Add wp-block classname to the product average rating block

* Add changelog

* Update changelog

* Fix lint issues
2024-09-26 04:00:11 -03:00
Gabriel Manussakis b017579815
[Accessibility] Fix typos in woocommerce-blocks e2e tests (#50738)
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2024-09-26 06:39:49 +00:00
Karol Manijak c687cdfbb6
Stop using unknown option for rsync during build process (#51696)
* Stop using unknown option for rsync during build process
* Add changelog
2024-09-26 07:07:19 +02:00
Barry Hughes 336e4f2d8a
Fix reference to `WC_Site_Tracking` (#51525)
Fix reference to `WC_Site_Tracking`.
2024-09-25 19:55:30 -07:00
Sam Seay 663a32f57a
50555 - Update button copy and change to outline button (#51609) 2024-09-26 13:17:38 +12:00
Sam Seay 018b73cd58
Add an option to mini cart block to navigate directly to checkout. (#51283) 2024-09-26 13:16:21 +12:00
Barry Hughes 37bb36994b
Update stable tag to 9.3.3 (#51692)
woorelease: Update stable tag to 9.3.3
2024-09-25 10:34:52 -07:00
Seghir Nadir 2f2d98ed45
Preserve dash in Mongolia postcodes (#51674)
* Preserve dash in Mongolia postcodes

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-25 17:24:52 +02:00
David Garcia Watkins bc56050569
[wcml-4848] Fixes for incorrect blocks in WC's refunds policy page (#51620)
* [wcml-4848] Fixes for incorrect blocks in WC's refunds policy page

Closes #51618

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-25 15:42:17 +02:00
Vladimir Reznichenko 3f4873bf3f
[dev] Monorepo: core build steps tweaks (copying assets) (#51612)
In this PR we aim to reduce filesystem modification when copying assets into the core by splitting copy tasks in three (one per source package) and using rsync over remove/copy combo.
2024-09-25 15:13:14 +02:00
Albert Juhé Lluveras 49fa0a7b1a
Allow setting the Shop page as the homepage in block themes (#51626)
* Allow settings the Shop page as the homepage in block themes

* Linting

* Add changelog file

* Fix SingleProductTemplateTests docblock

* Add unit tests

* Fix missing Shop page id

* Fix missing Shop page id (II)

* Fix missing Shop page id (III)

* Cleanup
2024-09-25 10:06:31 +02:00
Corey McKrill c4e758bab6
Redirect to canonical product permalink (#51637)
* Redirect to canonical product permalink

This ensures that if product permalinks are set to include the
%product_cat% replacement token, arbitrary values for that part of the
URL will redirect to the canonical product category value, rather than
successfully loading the single product page.

Fixes #24244

* phpcs exception

* Update plugins/woocommerce/changelog/fix-24244-custom-permalink

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2024-09-24 14:07:08 -07:00
Jonathan Lane 30ffbce09a
WC Cleanup plugin (#51593)
* WC cleanup plugin

* Fix linter errors

* More linter fixes

* Clean up spacing

* File doc comment

* Remaining linter problems

* Linter warnings too.  Sigh.

* Media cleanup, DB table cleanup, tax rate cleanup

* Exclude media files used in tests from cleanup

* Exclude media files regardless of extension

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-09-24 13:31:47 -07:00
Moon 12c2843458
Coming soon: Do not render header and footer if the theme does not support FSE (#51633)
* Render coming-soon template content without header and footer if the current theme is not a fse

* Check for store pages only

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

* Make sure get_the_block_template_html exist

* Lint fixes

* Lint fixes

* Lint fixes

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-24 19:53:31 +00:00
louwie17 a979d95130
Replace setTimeout with callback function for more reliable E2E tests (#51653)
* Replace setTimeout with callback function for more reliable E2E tests

* Add changelog

* Remove removePreview logic from product collection page
2024-09-24 12:24:43 -03:00
github-actions[bot] 9f5bc4bc4e
Delete changelog files based on PR 51630 (#51656)
Delete changelog files for 51630

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-24 19:40:52 +07:00
Thomas Roberts 94460bb394
Check if the order needs shipping before validating shipping address (#51630) 2024-09-24 12:53:24 +01:00
Chi-Hsuan Huang 442cb4e81b
[Beta tester] Add tool for changing woocommerce.com base URL (#51537)
* Refactor WooCommerce Helper class

This commit refactors the WooCommerce Helper class in the `class-wc-helper.php` file. The changes include:
- Updating the comparison operator from `==` to `===` in the `activate_plugin` condition.
- Renaming the `get_install_base_url` method to `get_woocommerce_com_base_url`.
- Adding a new `get_install_base_url` method that returns the base URL for the plugin auto installer.

These changes improve the readability and maintainability of the code.

* Refactor data source poller classes for marketing recommendations, payment gateway suggestions, shipping partner suggestions, inbox notifications, remote free extensions, and WooPayments promotion

- Refactor the data source poller classes for marketing recommendations, payment gateway suggestions, shipping partner suggestions, inbox notifications, remote free extensions, and WooPayments promotion to use a dynamic base URL for the data sources.
- Update the deprecated DATA_SOURCES constant to an empty array in each class.
- Add a new method get_data_sources() in each class to return the updated data sources with the dynamic base URL.
- Modify the constructor of each class to use the get_data_sources() method instead of the deprecated DATA_SOURCES constant.

* Add changelog

* Add set-woocom-base-url tool

* Add changelog

* Rename woo_com and woocom -> wccom

* Change to falsy check !url

* Change woocom/WOOCOM to wccom/WCCOM

* Change default value to https://woocommerce.com/

---------

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
2024-09-24 19:37:57 +08:00
Jason Kytros 85a048f1fd
Resolved fatal error when applying Brands-restricted coupon (#51577)
* Resolved fatal error when applying Brands-restricted coupon

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-24 14:16:03 +03:00
github-actions[bot] 4858ae62aa
Delete changelog files based on PR 51631 (#51646)
Delete changelog files for 51631

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-24 18:01:46 +07:00
github-actions[bot] ccbd29054a
Release: Remove 9.4 change files (#51530)
Delete changelog files from 9.4 release

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-24 18:00:08 +07:00
github-actions[bot] 045d174fc0
Prep trunk for 9.5 cycle (#51529)
Prep trunk for 9.5 cycle with version bump to 9.5.0-dev

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-24 17:59:48 +07:00
Manish Menaria a55812eba2
Product Collection: Update heading for Hand-Picked collection (#51643)
* Update heading for Hand-Picked collection

- Added 'recommend' to the keywords array.
- Changed heading content from 'Hand-Picked' to 'Recommended products'.

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-24 16:14:07 +05:30
Vladimir Reznichenko bca89cb14f
[dev] pnpm install: speedup postinstall hooks a bit (#51538)
In this PR, we aim to improve the speed of ppm installs by making changes in ppm configuration and post-install hooks. The main principle behind the changes is to leverage the identified parallelization potential.
2024-09-24 08:34:46 +02:00
RJ 59aa209761
enhance/create wrapper for all external func using proxy (#51432)
* Create a wrapper function for all external dependency function calls for safety

* Add changelog

* Improve remote logger

* Update RemoteLogger.php

* Add changelog

* enhanced it to use proxy instead of individual wrappers

* lint

* lint 8

* Revert blocking=true change

* pr feedback

* fixed

---------

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2024-09-24 10:49:47 +08:00
Barry Hughes 2a0ad34d99
Product CSV Importer > Restore expected default number of lines-to-import per batch (#51631)
Restore expected default number of lines-to-import per batch (product CSV import).
2024-09-23 14:46:01 -07:00
Tomek Wytrębowicz bef65063eb
Unhardcode menu titles for in page header (#51606) 2024-09-23 21:27:27 +02:00
Tomek Wytrębowicz 537818de6f
Ignore Analytics in the legacy `woocommerce_admin_reports` (#51592) 2024-09-23 21:11:56 +02:00
Mike Jolley 2c816457a9
Fix: get_checkout_fields() should return empty array if requested fieldset is not defined (#51508)
* If there is no fieldset, return an empty array instead of throwing notice

* changelog
2024-09-23 18:02:21 +02:00
Narendra Sishodiya 3ac409e03f
Fixed Fatal error call to a member function `is_empty() in mini-cart.php` (#51285)
* Fixed Fatal error call to a member function is_empty() in mini-cart.php:24

* Updated Template Version

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

---------

Co-authored-by: Néstor Soriano <konamiman@konamiman.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2024-09-23 17:59:47 +02:00
Joshua T Flowers 10b85cefb8
Only register block assets on the frontend during block render (#51517)
* Only register block assets on the frontend during block render

* Add changelog entry

* Add wc-blocks-registry as a dependency to product collection tester script

* Update docs manifest
2024-09-23 11:39:33 -04:00
github-actions[bot] 9647db4bb6
Delete changelog files based on PR 51541 (#51616)
Delete changelog files for 51541

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-23 22:02:50 +07:00
Seghir Nadir 07a0b8477b
Fix visual inconsisties in Cart/Checkout between elements and between Light/Dark modes (#51585)
* darker outline and double outline on focus

* flip outlines for shipping selector

* fix select outline in dark mode

* Fix input labels being cut off due to line height

* adjust outline colors

* fix rest of problems in dark mode

* fix express payment on checkout

* Fix broken styles for shipping cart in medium

* Always center input label

* Fix order note background in dark mode

* remove empty space in payment methods when there's no content inside

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

* fix linter issues

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-23 14:11:43 +02:00
louwie17 217f01c991
Add product dataviews without new nav (#51581)
* Add styling for dataviews with old nav

* Add toggle to toggle between new and old navigation

* Update dataviews dependency

* Fix width for list view

* Remove unused type

* Add changelogs
2024-09-23 08:51:55 -03:00
Manish Menaria fc6c932b1c
Fix: Prevent "is-descendent-of-single-product-block" from being added to external product URLs. (#51369)
* Fix: Prevent adding hidden input to external product forms with URLs

This commit addresses an issue where a hidden input field was being added
unnecessarily to external product forms that already have a URL. The changes
include:

1. Adding a check to determine if the product is an external product with a URL.
2. Only adding the hidden input field for products that are not external
   products with URLs.

This fix ensures that external product forms with URLs maintain their intended
functionality without the addition of unnecessary form elements.

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

* Fix lint issue

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-23 16:17:21 +05:30
Eason f9cf25e8d7
Legacy reports: Decouple the dependency between the legacy reports and the WooCommerce Status widget on the dashboard page (#51566)
* Reverse the dependency on drawing sparklines in the legacy reports from the WooCommerce Status widget on the dashboard page.

* Add a new class to simulate the loading plugin for the legacy reports.

* Decouple the dependency between the legacy reports and the WooCommerce Status widget on the dashboard page.

* Break down the method of forming HTML for the sparkline in Dashboard widget to avoid directly outputting HTML via a filtered callback.

* Update PHP unit tests for WC_Tests_Admin_Dashboard.

* Add changelog.

* Ensure the backward compatibility for the `woocommerce_after_dashboard_status_widget ` action.

Address: https://github.com/woocommerce/woocommerce/pull/51566#discussion_r1768751063

* Fix the incorrect indentation of a modified line of codes in the `WC_Admin_Dashboard` class.

Address: https://github.com/woocommerce/woocommerce/pull/51566#discussion_r1768690182

* Fix a PHP 8 deprecation message due to a required parameter after an optional parameter in the `WC_Admin_Dashboard` class.

Address: https://github.com/woocommerce/woocommerce/pull/51566#discussion_r1768776896

* Tweak the inaccurate PHPDoc for the `get_sales_sparkline ` method in the `WC_Admin_Report` class.

Address: https://github.com/woocommerce/woocommerce/pull/51566#discussion_r1768804777
2024-09-23 17:08:47 +08:00
Chi-Hsuan Huang 31d847bd6f
Allow change remote spec data source base URL via filter (#51532)
* Refactor WooCommerce Helper class

This commit refactors the WooCommerce Helper class in the `class-wc-helper.php` file. The changes include:
- Updating the comparison operator from `==` to `===` in the `activate_plugin` condition.
- Renaming the `get_install_base_url` method to `get_woocommerce_com_base_url`.
- Adding a new `get_install_base_url` method that returns the base URL for the plugin auto installer.

These changes improve the readability and maintainability of the code.

* Refactor data source poller classes for marketing recommendations, payment gateway suggestions, shipping partner suggestions, inbox notifications, remote free extensions, and WooPayments promotion

- Refactor the data source poller classes for marketing recommendations, payment gateway suggestions, shipping partner suggestions, inbox notifications, remote free extensions, and WooPayments promotion to use a dynamic base URL for the data sources.
- Update the deprecated DATA_SOURCES constant to an empty array in each class.
- Add a new method get_data_sources() in each class to return the updated data sources with the dynamic base URL.
- Modify the constructor of each class to use the get_data_sources() method instead of the deprecated DATA_SOURCES constant.

* Add changelog
2024-09-23 15:10:40 +08:00
Tomek Wytrębowicz e4d0123a36
Fix taxes totals mismatch at reports table (#51218) 2024-09-22 22:04:52 +02:00
Tomek Wytrębowicz 15bcbbdcfd
Fix Tax Analytics total results & export (#51270) 2024-09-22 21:05:23 +02:00
Karol Manijak 03749a0a40
Product Collection: Add option for current product as a reference (#51359)
* Introduce RadioControl

* Provide better copy and improve styling of radio button

* Implement the logic of choosing current product as a reference

* Add placeholder state in product chooser

* Add placeholder image to product chooser

* Add changelog

* Refactor file

* Improve the condition choosing the default radio value

* Update E2E tests

* Format SVG icon and optimize it

* Increase a gap in radio control

* Make the labels less spcific to related products

* Rename some variables to more meaningful names

* Show placeholder img if product doesnt have one

* Fix type

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2024-09-22 15:30:29 +05:30
Bart Kalisz 35ba49a1f2
Product Collection: Implement the Hand-Picked collection (#51141)
* Fixed PHP 7.4 Compatibility

The splat operator does not support associative arrays until PHP 8.1.

* Added Related Products Collection Boilerplate

* Added `woocommerceRelatedTo` Collection Parameter

This parameter allows the block to query for products that are related
to the given product IDs.

* Added Collection Related Product Filter

Using `woocommerceRelatedTo`, queries may restrict the products returned
to those that are related to the given product ID(s).

* Removed Unnecessary Tracking

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

* Removing Misunderstood Option

* Linting Fix

* Fixed Test

* Initialize the Hand-Picked collection

* Removed Unnecessary Keyword

* Render the collection-specific control

* try removing for fixing gh syntax hl

* add back

* tweak icon render

* combine conditions for early return

* Remove timeFrame from the query

* Set control label per context

* Use primitives for the icon

* Hide 'order by' control for the Hand-Picked collection

* Support Unlimited `wc_get_related_products()`

This changes related product fetching so that `-1` will return all
related products. I also removed a second +10 offset that seems
to have been accidentally added eight years ago.

* Revert "Set control label per context"

This reverts commit cd537befbe.

* Update titles and description

* Enable sorting by entered order

* Removed `woocommerceRelatedTo` Param

Since we're going to use the collection name, we don't need
this functionality any longer.

* Simplified `post__in` Filtering

Since `merge_queries` was already using an intersection merge for
`post__in`, this second function is unnecessary. I've removed it
as well as refactored the merging logic.

* Pass Collection Name To Final Query

* Improve the query merging logic

* Added Custom Collection Handlers

Developers can register collections along with handlers that implement
the custom behavior.

* Removed Second Test Query Construction

As it was, `build_query_vars_from_query_block()` was triggering the
ProductCollection instance hooked into WordPress. After that, we
called `build_frontend_query()` on our test instance. This caused some
weird behavior in tests. As a result, however, the tax_query merge
test couldn't rely on the tax_query transformation done by WordPress.

* Added Related Product Collection Handlers

* Revert "Support Unlimited `wc_get_related_products()`"

This reverts commit 41c837202e.

* Fixed Preview Mode Query

It looks like we were checking the wrong place for the preview
state.

* Improve the query merging logic

* Fixed Test

* Updated Collection Heading

* Handle collection context / no results state

* Small cleanup

* Better Collection Test Teardown

Passing a callable back means that we can use variables in the
setUp and then the tearDown without any confusion.

* Removed Unnecessary Test Provider

* Fixed `$post__in` Merging

When the intersection is empty it was returning all products. This
makes it so that it returns nothing when there's no results.

* Set perPage to 0 and add Pagination block for better discoverability

* Improve empty state in Editor by providing meaningful instruction

* Make code more defensive

* Hide more filters in scope of handpicked through hideFilters API

* Fixed PHPDoc

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>

* Hide Empty Related Product Collections

* Removed Duplicate Query Function

* Added Hand-Picked Collection Handler

* Revert changes to pnpm

* Improve comment for empty Hand-Picked collection

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

* Fix: Pagination not working on Frontend

Remove perPage and pages attributes from hand-picked collection

* Remove unused code

* Revert "Improve empty state in Editor by providing meaningful instruction"

This reverts commit 9ac5c20d5e.

* Do not apply layout styles for empty results

* Improve the wording on the empty results message

---------

Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
2024-09-21 20:10:10 +05:30
Karol Manijak 6222124793
Add Upsells collection (#51374)
* Fixed PHP 7.4 Compatibility

The splat operator does not support associative arrays until PHP 8.1.

* Added Related Products Collection Boilerplate

* Added `woocommerceRelatedTo` Collection Parameter

This parameter allows the block to query for products that are related
to the given product IDs.

* Added Collection Related Product Filter

Using `woocommerceRelatedTo`, queries may restrict the products returned
to those that are related to the given product ID(s).

* Removed Unnecessary Tracking

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

* Removing Misunderstood Option

* Linting Fix

* Fixed Test

* Removed Unnecessary Keyword

* Support Unlimited `wc_get_related_products()`

This changes related product fetching so that `-1` will return all
related products. I also removed a second +10 offset that seems
to have been accidentally added eight years ago.

* Removed `woocommerceRelatedTo` Param

Since we're going to use the collection name, we don't need
this functionality any longer.

* Simplified `post__in` Filtering

Since `merge_queries` was already using an intersection merge for
`post__in`, this second function is unnecessary. I've removed it
as well as refactored the merging logic.

* Pass Collection Name To Final Query

* Added Custom Collection Handlers

Developers can register collections along with handlers that implement
the custom behavior.

* Removed Second Test Query Construction

As it was, `build_query_vars_from_query_block()` was triggering the
ProductCollection instance hooked into WordPress. After that, we
called `build_frontend_query()` on our test instance. This caused some
weird behavior in tests. As a result, however, the tax_query merge
test couldn't rely on the tax_query transformation done by WordPress.

* Added Related Product Collection Handlers

* Revert "Support Unlimited `wc_get_related_products()`"

This reverts commit 41c837202e.

* Fixed Preview Mode Query

It looks like we were checking the wrong place for the preview
state.

* Fixed Test

* Updated Collection Heading

* Add Upsells collection definition

* Register Upsells

* Add collection handlers for Upsells

* Add changelog

* Remove on sale query param

* Better Collection Test Teardown

Passing a callable back means that we can use variables in the
setUp and then the tearDown without any confusion.

* Removed Unnecessary Test Provider

* Added Upsell Collection Unit Test

* Product ID Confidence Check

* Added Collection Product Reference

* Don't display Upsells collection if there's no upsells

* Change the Upsells collection heading

* Add Upsells supporting cart context

* Consume the cart productIds and display Upsells in there

* Fixed `$post__in` Merging

When the intersection is empty it was returning all products. This
makes it so that it returns nothing when there's no results.

* Fix lint

* Extract the variable

* Fix lint

---------

Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2024-09-21 19:28:47 +05:30
Christopher Allford 7a7b94025a
Product Collection: Introduce "Related Products" Collection (#51076)
* Fixed PHP 7.4 Compatibility

The splat operator does not support associative arrays until PHP 8.1.

* Added Related Products Collection Boilerplate

* Added `woocommerceRelatedTo` Collection Parameter

This parameter allows the block to query for products that are related
to the given product IDs.

* Added Collection Related Product Filter

Using `woocommerceRelatedTo`, queries may restrict the products returned
to those that are related to the given product ID(s).

* Removed Unnecessary Tracking

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

* Removing Misunderstood Option

* Linting Fix

* Fixed Test

* Removed Unnecessary Keyword

* Support Unlimited `wc_get_related_products()`

This changes related product fetching so that `-1` will return all
related products. I also removed a second +10 offset that seems
to have been accidentally added eight years ago.

* Removed `woocommerceRelatedTo` Param

Since we're going to use the collection name, we don't need
this functionality any longer.

* Simplified `post__in` Filtering

Since `merge_queries` was already using an intersection merge for
`post__in`, this second function is unnecessary. I've removed it
as well as refactored the merging logic.

* Pass Collection Name To Final Query

* Added Custom Collection Handlers

Developers can register collections along with handlers that implement
the custom behavior.

* Removed Second Test Query Construction

As it was, `build_query_vars_from_query_block()` was triggering the
ProductCollection instance hooked into WordPress. After that, we
called `build_frontend_query()` on our test instance. This caused some
weird behavior in tests. As a result, however, the tax_query merge
test couldn't rely on the tax_query transformation done by WordPress.

* Added Related Product Collection Handlers

* Revert "Support Unlimited `wc_get_related_products()`"

This reverts commit 41c837202e.

* Fixed Preview Mode Query

It looks like we were checking the wrong place for the preview
state.

* Fixed Test

* Updated Collection Heading

* Better Collection Test Teardown

Passing a callable back means that we can use variables in the
setUp and then the tearDown without any confusion.

* Removed Unnecessary Test Provider

* Fixed `$post__in` Merging

When the intersection is empty it was returning all products. This
makes it so that it returns nothing when there's no results.

* Fixed PHPDoc

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>

* Hide Empty Related Product Collections

* Fix lint issue

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2024-09-21 16:12:58 +05:30
Herman 62a2968afd
Add screen reader text for ratings data on product cards (#51571)
* Add screen reader text for ratings data on product cards

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-20 16:57:45 +00:00
Thomas Roberts fa977c2da1
Replace flaky Local Pickup e2e test with PHP and JS unit test (#51554) 2024-09-20 17:25:19 +01:00
Raja sekar 017d649ae7
Show correct decimals on product price and show the sale price of products (#51499)
* add regular price and sale price flag to product apis and types

* add sale price and screen reader text for prices on product cards

* fix typo on sale flag

* add regular price and sale price flag to product apis and types

* add sale price and screen reader text for prices on product cards

* fix typo on sale flag

* Changelog.

* address feedback on sale price VO text

---------

Co-authored-by: Herman <KokkieH@users.noreply.github.com>
Co-authored-by: And Finally <andfinally@users.noreply.github.com>
2024-09-20 21:13:01 +05:30
Mike Jolley aacae66eb0
Delayed account creation: Admin settings (#51236)
* Settings first pass

* New Settings UI

* Respect woocommerce_enable_delayed_account_creation at block level

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

* Check input exists

* Add new setting to tests

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-20 16:20:09 +01:00
Vlad Olaru 1ff28fd174
Update Payments menu item display and linking behavior (#51541)
* Minor cleanup

* refact: Rename must_be_visible to is_incentive_visible for clarity

* refact: Rename register_payments_welcome_page to register_menu_and_page for clarity

* Don't show the incentive page if the user can't manage WC

* Introduce menu item when no incentive

* Don't recommend additional gateways when WCPay is present

* Render gateway suggestions on the WCPay task page, also

* Add changelog entry

* Remove short array syntax

* Lint fixes

* Simplify Payments task view logic

* Simplify WooPayments task view logic

* Improve WooPayments task complete logic

* WooPayments can't be connected or onboarded if it is not active

* refact: Rename private static method

* Improve logic to determine the Payments task slug by factoring in the extended task list also

* docs: Add details about our use of the Payments task logic

* Add type hint

* Do not recommend offline methods when WooPayments is supported

* On suggestion enablement redirect to the same task page

* Lint fixes

* test: Fix unit tests

* Maintain deprecated navigation logic
2024-09-20 15:53:10 +03:00
David Allsop ad2d18200f
Add additional body class for the account dashboard (#30050) (#51147)
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Nestor Soriano <konamiman@konamiman.com>
2024-09-20 11:21:33 +02:00
Mike Jolley 9c58f198cf
Ensure `QuantityLimits::limit_to_multiple` receives correct values to prevent fatal errors (#51451)
* Ensure values passed to limit_to_multiple are integers

* changelog

* Type and value enforcing for filters

* fix max value
2024-09-19 16:24:13 +01:00
Mike Jolley d567c6c698
Delayed Account Creation: Support option to send password setup link to customer via email (#51227)
* Update form handling to work with automatically generated passwords

* Keep user logged in after password reset.

* Ignore comments for hooks in changed method

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

* Checkmark list style

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-19 15:03:27 +01:00
Mike Jolley c5ed90535f
Fix script tag handling for inner blocks in the cart (#51498)
* Avoid parsing scripts when dealing with inner blocks—return as-is

* changelog
2024-09-19 14:51:09 +01:00
Mike Jolley bf549e6d8f
Defend against missing session in cart functions to prevent fatals (#51442)
* Ensure session is callable in cart functions

* Changelog
2024-09-19 13:36:54 +01:00
Cem Ünalan 8ca18f06ad
Marketplace: hide the scrollbar from the category selector (#51527)
* Marketplace: hide the scrollbar from the category selector

Also fixed some button gradient issues

* Marketplace: change scroll helper button cursor

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-19 12:26:06 +00:00
Veljko V. ec9cdbdbf7
Fix and improve k6 perf test My Account Open Order (#51334)
* Add customer id to orders and update test to look for proper title

* Add changelog

* Update my account open orders test and assign customer ID

* Fix linting issues

* Add final fix to the my account open order test

* Add customer order to test

* Add comment on the top of the file

* Add two more comments to the top of the file to avoid linting failure

* Revert changes made to response in test and orders

* Rename response to r in orders

* Remove unnecessary code from orders

* Move order creation to setup and update tests

* Include check for the order ID validation

* Relogic add customer order

* Rename test comment

* Update setup to create customer and config, readme, relevant tests

* Remove console log from the test
2024-09-19 11:14:20 +02:00
louwie17 11b1e31ac3
Update the dataviews package dependency (#51511)
* Initial update

* Revert dependency output change

* Add changelogs
2024-09-19 10:43:05 +02:00
Vladimir Reznichenko b0799716aa
[dev] Monorepo: bypass git clone for WordPress core when spinning off wp-env (#51457) 2024-09-19 10:33:57 +02:00
Jonathan Lane 2e69e94028
Exclude skipped e2e tests from auto-closure (#51528)
Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-09-19 09:02:04 +02:00
Chi-Hsuan Huang dfd7d52d6b
[beta tester] Simulate core error early in the request lifecycle before WP fully loaded. (#51330)
* Improve remote logging tool to simulate core error early in the request lifecycle before wp fully loaded

* Disable wp error handler when simulate_woocommerce_error
2024-09-19 12:22:53 +08:00
DAnn2012 2fc6528c61
Fix typo (task-list-completed.tsx) (#51484)
* Update task-list-completed.tsx

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2024-09-19 03:14:36 +00:00
Barry Hughes 34aa4f07f1
Update stable tag to 9.3.2 (#51522)
Update stable tag to 9.3.2
2024-09-18 14:06:54 -07:00
Alex Florisca 9b8256cc3e
[Feature] Express Checkout Improvements (#50791)
* Add new buttonAttributes API to style express checkout buttons coherently (#47899)

* Expose buttonAttributes to the express payment methods

* Add size and label attributes to the express checkout area

* Remove defaultHeight

* default button Label

* Remove the button label attribute

* Remove px from height

* Change large button height to 55px

* Load express checkout block with attributes

* Add toggle and borderRadius controls and remove getting border radius from the theme

* Remove extra border radius text

* Only pass buttonAttributes if toggled on

* Move express payment block attribute logic into a Provider

* Tidy up editor grid and parse attributes into context on frontend

* Add px to border-radius input

* Express payment methods not selectable

* Add a test

* lint fixes

* default button height is 48 not 4

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

* Update docs

* Add tests for express payment methods

* Center images within the express payment area in the editor

* Apply the buttonAttributes to the li container in the editor regardless of showButtonStyles

* Fix style issue

* fix linting

* fix lint again

* Update manifest

* Update docs manifest

* Resize images in editor

* lint fix

---------

Co-authored-by: github-actions <github-actions@github.com>

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

* Synchronise the express payment settings between the Cart & Checkout blocks (#50688)

* Add express payment methods to sidebar

* Only add extra props for express payment methods

* Update docs

* Make title, description and gatewayId types optional

* Update docs

* Fix types again and editor side

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

* handle situation when no methods are active

* Update manifest

* Add express payment methods to inspector controls for express checkout block (#50983)

* Remove forced styles on the editor

* Remove the darkMode setting from the buttonAttributes API (#51109)

* Remove darkMode from the buttonAttributes API

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

---------

Co-authored-by: github-actions <github-actions@github.com>

* Accept supports declarations for express payment style controls + merchant ux improvements in the editor (#51296)

* Fix images in editor displaying weird

* Fix long express payment names breaking layout

* Default to uniform styles off

* Use heightControl for border radius and fix height for cart buttons

* Move formatting title and description to the config validation

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

* Fix linting

* Fix failing test

* Add back the 48px height for images in editor

* Fix linting again

* Update docs

* Update docs manifest

* Update docs to fix linting

* Add comment to test to better explain why we are expecting a console warning

* make strings translatable

* Sync cart & checkout directly without option

* Remove current styles

* Change the beta label

* Replace < and > with symbol references in docs

* Update docs manifest

* Increase padding of beta label

* fix linter issues

* change to using looger helper

* fix CSS

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2024-09-18 19:49:27 +00:00
Nathan Silveira 96719139be
Add global_unique_id parameter to products REST API (#51264)
* Add global_unique_id parameter to products REST API

* Remove unnecessary if statement related to commas and trim request content
2024-09-18 15:26:40 -03:00
Jonathan Lane 9d135ee2f5
Skip top flaky tests (#51510)
* Skip top flaky tests

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

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-09-18 18:43:12 +02:00
github-actions[bot] df37ccf8c5
Delete changelog files based on PR 51449 (#51477)
Delete changelog files for 51449

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-18 19:34:07 +07:00
github-actions[bot] 13f5eee40b
Delete changelog files based on PR 51441 (#51497)
Delete changelog files for 51441

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-18 19:33:24 +07:00
github-actions[bot] 8042fcdae3
Delete changelog files based on PR 51456 (#51496)
Delete changelog files for 51456

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-18 19:32:28 +07:00
Boro Sitnikovski ce66b55bc5
In app search improvements feature branch (#51413)
* Add search results count to the in-app marketplace (#51266)

* Add searchResults to context

* Use setSearchResults in Content

* Add ribbons to the tabs

* Changelog

* Use setState as the function name

* Only show ribbon counts when there's an active search

* Refactor how 'setSearchResultsCount' is used (h/t @mcliwanow)

* Don't populate initial search results

* Unify css styling

* Marketplace: bring back the loading state (#51342)

* Marketplace: bring back the loading state

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

---------

Co-authored-by: github-actions <github-actions@github.com>

* Remove in-app marketplace Search results tab and unify results into existing tabs (#51297)

* Remove search results component and any references to it

* Persist current tab for searching, or default to extensions if tab is not set

* Persist term when switching across tabs

* Lint

* When a search is initiated, fetch all categories to keep the tab counts up to date.

The necessary filtering to display data to the current screen will be performed on the frontend.

* Apply correct colors to the tabs, as per design

* Beyond query.term, also rely on isLoading so that search result counts don't jump

* Address an issue when the user searches for something that returns no results in the business services tab

* Changelog

* Addressed :)

* Change key to category

* Fix category filter being broken

Whenever a category is requested, we need to do an additional request with the category param being the current category (overriding extensions/theme/business services).

Ideally the backend API would make a distinction between type (theme/extension/business service) and category, but this hack should do for now.

* Lint

* Remove unused variables h/t @KokkieH

* Lint

* Revert "Lint"

This reverts commit 0b2d2dca6d.

* Actually fix lint without introducing infinite loop

Reproducible at http://localhost:8080/wp-admin/admin.php?page=wc-admin&term=payments&tab=extensions&path=%2Fextensions&category=customer-service

* Show category selector even if there are no results displayed

* Update comment to be less misleading

* Query isn't used here

* Update Marketplace search component (#51313)

* Update Search placeholder text

* Replace search component with one from @wordpress/components

* Make mobile search field font consistent with desktop

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

* Handle import errors for SearchControl component

---------

Co-authored-by: github-actions <github-actions@github.com>

* Marketplace: update category selector (#51309)

* Marketplace: update category selector

Remove the dropdown on the desktop view and show all items, even if
overflowing. Added helper buttons to scroll to the right to show more.

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

* Marketplace: remove category sroll helpers from tabindex

GitHub:
https://github.com/woocommerce/woocommerce/pull/51309/files#r1758448638

* Marketplace: Remove selectedTab reference from product.tsx

This is probably included due to the merge conflict

* Marketplace: tweak category scroll button narrower

---------

Co-authored-by: github-actions <github-actions@github.com>

* Lint

* Fix 2 lint errors

* Fix another lint error (useMemo) h/t @KokkieH

* Add load more button in-app (#51434)

* Add additional fields returned by search API to marketplace types

Ensure components have access to additional fields

* Add LoadMoreButton component

* Only render Load More button if there are additional pages of results

* Fetch and display next page of results in Load More button is clicked

* Simplify renderContent function to have less repetition

- Hide load more button while fetching results

* Improve loading of new products

- Ensure keyboard focus goes to first new product after Load More is clicked

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

* Add blank line to separate sections

* Set category param based on current tab when loading more products

* Improve busy-state screen reader text

Co-authored-by: Boro Sitnikovski <buritomath@gmail.com>

* Add missing dependency

* Move getProductType() function to functions.tsx

- Do not show load more button if isLoading state is true

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Boro Sitnikovski <buritomath@gmail.com>

* Rework the values used with `setSearchResultsCount`

After https://github.com/Automattic/woocommerce.com/pull/21678/files we
get a `totalProducts` so we can re-use that.

Also remove setting the counts when paginating since we set them to the
total.

* Add search complete announcement h/t @KokkieH

* Show update count only if greater than 0 h/t @andfinally

* Switch to Extensions tab if on My subscriptions when searching

* yoda

---------

Co-authored-by: Cem Ünalan <raicem@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Herman <KokkieH@users.noreply.github.com>
2024-09-18 14:14:30 +02:00
Ivan Stojadinov 4bc4649008
[e2e] External - Expand WPCOM suite, part 3 (#51422)
* Skip "Restricted coupon management" - error 500

* Make `wooPatterns` element more specific

* Skip "Merchant can view a list of all customers" - more customers due to using existing website

* No LYS on WPCOM

* Dismiss notice if shown

* Expand WPCOM suite

* Click on `Canada`

* Click on `Canada`

* Be more specific about `Delete` button

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

* Skip two more tests - WC patterns and block

* Remove usage of `networkidle`

* Handle notice if present with `addLocatorHandler`

* Fix ESLint issue

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-18 13:24:38 +02:00
Néstor Soriano 16e072879b
Fix: "Import file path is invalid" in Windows (#51456)
* Fix WC_Product_CSV_Importer_Controller::check_file_path failing on Windows
2024-09-18 13:15:15 +02:00
Naman Malhotra 3df48f2bd7
Revert low stock notification changes (#51441)
* Revert - Change when stock notif emails are triggered

* added changelog

* restored comment

* restored more comment

* lint fixes

* Add docblock.

---------

Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
2024-09-18 18:12:23 +07:00
Ilyas Foo 6a83e8d301
Fix deprecation notice in coming soon and store-only mode (#51474)
* Wrap parse_str under a check

* Changelog
2024-09-18 18:06:38 +08:00
Maikel Perez f529d927a2
CYS: Fix Looker dashboard data (Track & display average loading times) (#51461)
* Track customize_your_store_assembler_hub_editor_loaded event to measure CYS loading time

* Add changelog file
2024-09-18 09:59:14 +02:00
Vedanshu Jain 3cdf45f69c
Modify API response tests to assert that expected key values are present (#51465)
Modify API response tests to assert that expected key values are present.

This differs from earlier assertion which checks for exact equality. However the earlier assertion was brittle and would fail when a new property is added, for example in https://core.trac.wordpress.org/ticket/61739.

With this change, any addition to schema will not breaking existing API tests.
2024-09-18 12:58:38 +05:30
Tung Du 1b58098848
[Experimental] Product Filters Chips style and new interactivity API implementation (#51393) 2024-09-18 13:16:07 +07:00
RJ ec29880e3e
fix: added pre-API call permissions check on APIs being called on non-admin accessible screens (#51406)
fix: no permissions api errors
2024-09-18 12:53:52 +08:00
Sam Seay 2e3013555e
Check if button element exists when triggering added_to_cart (#51449) 2024-09-18 14:13:47 +12:00
Chi-Hsuan Huang cf7fd8303c
Improve remote logging structure and content (#51360)
* Refactor RemoteLogger to format error file paths and remove absolute paths

* Add changelog

* Change "**" -> "./"
2024-09-18 08:58:10 +08:00
Chi-Hsuan Huang cfca07eca8
Reducing Noise in Remote Logging (#51357)
* Refactor remote logging in WooCommerce

This commit refactors the remote logging functionality in WooCommerce to improve its efficiency and flexibility.

- In the `class-woocommerce.php` file, the `context` array now includes a new key `remote-logging` to indicate whether the error should be logged remotely if remote logging is enabled.

- In the `RemoteLogger.php` file, the `file` key in the `context['error']` array is now assigned to the `$log_data` array, and then unset from the `context['error']` array.

- The `should_handle` method in the `RemoteLogger` class now checks for the presence of the `remote-logging` key in the `context` array. If it is not set or set to `false`, the log is ignored.

- The `RemoteLoggerTest.php` file includes new test cases to ensure that the `should_handle` method returns `false` when the `remote-logging` key is not present in the `context` array.

These changes improve the remote logging functionality in WooCommerce and make it more robust and efficient.

* Revert log format change

* Set remote-logging context to true in log remote event method

* Add changelog

* revert change

* revert change
2024-09-18 08:57:32 +08:00
Narendra Sishodiya c2fa5eeff5
Updated Product attributes placeholder to e.g. length or weight (#51379)
* Updated Product attributes placeholder to e.g. length or weight

* Added Changelog

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

* Delete changelog/51134-product-attribute-placeholder-update

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

* Revise changelog.

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

* Satisfy linter.

* Increase exactitude to reduce ambiguity levels.

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2024-09-17 15:59:22 -07:00
Moon 5fe53a2e3f
Add locale param to jetpack redirect url (#51392)
* Add locale from php

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

* Return a full locale with language and region code

* Fix style

* Fix error

* Lint fixes

* Lint fixes

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-17 13:46:26 -07:00
Narendra Sishodiya e03c51c5ed
Fixed call to member function is_visible Fatal Error (#51286)
* Fixed call to member function is_visible Fatal Error

* Implemented the suggestions

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

* Updated the @version tag

* Promote 'comment' to actual changelog entry.

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2024-09-17 11:30:47 -07:00
Jason Kytros ea6e7295ec
Merge WooCommerce Brands into core (#50165)
* Move WooCommerce Brands into core

* Fix linting errors in brand-thumbnails.php

* More lint fixes for brand-thumbnails.php

* Fix lint issues in brand-description.php

* Fix lint errors for brand-thumbnails-description

* Lint errors: Fix taxonomy-product_brand

* Lint errors: fix taxonomy-product_brand

* Linting: Try adding a space between ignore command and docblock

* Another try to remove the lowercase file name error

* Another try removing lint error for lowercase files

* Lint errors: Fix brands-a-z.php

* More lint fixes for brands-a-z.php

* More lint fixes for brands-a-z.php

* Lint fixes: brand-description.php

* Another try fixing lint errors for brand-description.php

* Another try fixing lint errors for brand-description.php

* More fixes for brand-description.php

* Fix lint errors for Packages.php

* More fixes for Packages.php

* Linting fixes for Brands.php

* Added docblocks for WC_Widget_Brand_Thumbnails variables

* Add script to fix coding standards for files changed in branch

* Run autofix script for linting

* Lint fixes for class-wc-widget-brand-thumbnails.php

* More lint fixes for: class-wc-widget-brand-thumbnails.php

* More lint fixes for class-wc-widget-brand-thumbnails.php

* Lint fixes for class-wc-widget-brand-nav.php

* lint fixes: ignore docblocks

* Another try to fix missing docblocks

* Another try to fix missing docblocks

* Another try fixing missing docblocks

* Better messages for fix-branch.sh

* Fix lint errors in class-wc-widget-brand-description.php

* Fix linting errors in REST API and functions classes

* Fix linting issues in class-wc-brands.php

* More lint fixes for wc-brands.php

* More lint fixes for wc-brands.php

* Fix lint errors for wc-brands-coupons.php

* Fix lint errors for class-wc-brands-block-templates.php

* Fix linting errors for class-wc-brands-block-template-utils-duplicated.php

* Fix lint errors in class-wc-admin-brands.php

* More fixes in class-wc-admin-brands.php

* More class-wc-admin-brands.php

* More lint fixes for: class-wc-admin-brands.php

* More lint fixes for class-wc-admin-brands.php

* Transfer unit test

* Transfer e2e test

* Added specific versions to templates

* Added changelog

* Another try for HTML templates version

* Fix lint errors in test files

* More lint fixes

* Fix lint warnings

* Added brands to list of expected REST API fields

* More lint warning fixes

* More lint warning fixes

* Updated unit tests to include brands

* Remove whitespace

* Added declare( strict_types = 1); to all PHP files

* Added declare( strict_types = 1) to test file as well

* Fix: There must be exactly one blank line after the file comment

* Temporarily remove Brands e2e tests

* Move Brands blockified templates

* Remove script to fix lint errors in current branch

* Try removing pull-package-deps

* Bring back deps

* Commit pnpm-lock.yaml

* Add debug statements

* More debug statements

* Make regular expression more specific

* Make matches more specific

* Search only for PHP templates

* Bring back whitespace

* Remove unnecessary change

* Update pnpm-lock.yaml

* Change the way Brands files are included

* Include all files

* Prevent Brands assets from being double-enqueued

* Move Brands scripts handling into core

* Revert changes in the template-changes.ts script

* Use strict in_array

* Add scaffolding for Brands test

* Add more scaffolding for Brands tests

* Enhance e2e test by adding steps for creating a Brand

* Move Brands test to Playwright folder

* Added manifest

* Fix lint errors in tests

* Move Brands coupons test into core's coupons tests

* Fix linting error in tests

* Move all Brands initialization within the /Internal/Brands class

* Rename `$merged_packages` to `$merged_plugins`

* Add force disable method back

* Move Brands logic outside core files

* Rename admin styles

* Remove brands logic from core's admin class

* Roll back all changes in admin assets class

* Fix linting errors

* Move REST API logic to Brands main class

* Introduce an option to control whether the Brands package is enabled.
Prevent autoloader from loading classes already loaded by individual Packages.
Fix an issue with Brands admin styles.

* Bring back pnpm-lock

* Add comment

* Split long line into two

* Review default values for remote variant assignment

* Rename global functions and add polyfills for deprecated functions

* Bump versions

* Fix some lint errors

* More lint fixes

* Set woocommerce_remote_variant_assignment for Brands to be enabled for unit tests

* Replace reserved word class with class_name

* Another try to include Brands files in tests

* Remove Brands from REST API tests

* Skip Brands tests while Brands is behind a feature flag

* Lint fixes

* Remove empty line

* Added feature flag.

* Fix widgets form

* Fix lint errors for brand description widget

* Fix lint errors for brand description widget

* Fix lint errors

* Bump version

* Updated tooltips for Brands coupon restrictions to match core's

* Fix lint errors

* More lint fixes

* Add REST API v3 for Brands

---------

Co-authored-by: Walther Lalk <83255+dakota@users.noreply.github.com>
2024-09-17 18:13:46 +03:00
Albert Juhé Lluveras 514b39eea0
Fix a type mismatch in UpdateProducts.php (#51408)
* Fix a type mismatch in UpdateProducts.php

* Add changelog file

* Fix a type mismatch in UpdateProducts.php (II)
2024-09-17 16:56:55 +02:00
Chi-Hsuan Huang 6bc2244ec9
Reduce dependency of remote logging on WC_Tracks (#51365)
* Simplify WC_Tracks::get_blog_details() to reduce its dependencies

* Add changelog

* Remove store_id field

* Improve the check
2024-09-17 22:31:55 +08:00
Chi-Hsuan Huang dee8c619f0
Refine PHP Fatal Error Counting (#51363)
* Refine PHP Fatal Error Counting in MC Stat

* Add changelog

* Fix import
2024-09-17 22:31:44 +08:00
Mike Jolley 554434ea3d
Cart Shortcode: `wc_get_cart_url` should only return current URL if on the cart page (#51384)
* Narrow logic further by only checking if the current page is the cart, not WOOCOMMERCE_CART

* changelog
2024-09-17 13:56:01 +01:00
Mike Jolley be17f843b6
Add missing `wp-block-` classnames to order confirmation blocks, Store Notices, and Breadcrumbs (#51380)
* Add missing wp-block-x classname to order confirmation blocks

* Use get_block_wrapper_attributes for store notices block

* Breadcrumbs and notices

* Changelog
2024-09-17 13:30:22 +02:00
Seghir Nadir 66523872f3
Support controlling address card state from data store in Checkout block (#51386)
* fix line height

* Support controlling address card from data store

* expand billing address on unsync

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

* disable linter rule

* remove empty section

* remove used vars

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-17 10:56:15 +00:00
Karol Manijak e354295387
Update Markdown lint allowing the same headings if they're not siblings (#51438)
* Set markdown rule about Multiple headings to check siblings only

* Change the doc to have same headings but not siblings as example

* Add changelog

* Update docs manifest
2024-09-17 12:44:15 +02:00
Ivan Stojadinov acc313a9b2
[e2e] External - Expand WPCOM suite, part 2 (#51414)
* Add /merchant tests to the WPCOM suite

* Skip "can manually add a variation" on WPCOM

* Skip "Coupon management" - API returns 500 on delete

* Resolve `wp-block-woocommerce-checkout-order-summary-block` on the first element

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-17 10:43:43 +02:00
Manish Menaria 861bc091d4
Product Collection - Add Editor UI for missing product reference (#51114)
* Initial implementation of the missing product state

- Changed `getProductCollectionUIStateInEditor` to a hook `useProductCollectionUIState`.
	- As we added logic to check if selected product reference is deleted which require making an API call. Therefore, I decided to use a hook.
- While making an API call to check if product reference is deleted, I decided to show spinner in the block.
- Introduced new UI state `DELETED_PRODUCT_REFERENCE` to handle the missing product state.
- Updated existing `ProductPicker` component to handle the new UI state.
	- It's better to use existing component for the missing product state, as it already has all the required UI.

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

* Use getEntityRecord to check if product exists and other improvements

* Remove console log

* Add E2E tests for deleted product reference in Product Collection block

This commit introduces new E2E tests to verify the behavior of the Product
Collection block when dealing with deleted product references. The changes
include:

1. New test suite in register-product-collection-tester.block_theme.spec.ts
2. Modification to product-collection.page.ts to support custom product selection
3. Minor update to utils.tsx to handle trashed products

These tests ensure that the Product Collection block correctly handles
scenarios where referenced products are deleted, trashed, or restored,
improving the overall reliability of the feature.

* Simplify product creation in Product Collection block test

* Refactor E2E test for delete product reference picker

1. Removing the unnecessary `test.describe` block for "Deleted product reference"
2. Eliminating the `beforeEach` hook that was creating a test product
3. Integrating the test product creation directly into the main test

This change simplifies the test structure and improves readability while
maintaining the same test coverage for the Product Collection block's
behavior when dealing with deleted or unavailable products.

* Simplify logic for product collection UI state

This commit simplifies the handling of the `usesReference` prop in the
Product Collection block:

1. In `edit/index.tsx`, directly pass `usesReference` to
   `useProductCollectionUIState` hook without conditional spreading.

2. In `utils.tsx`, update the type definition of `usesReference` in the
   `useProductCollectionUIState` hook to explicitly include `undefined`.

* Refactor Product Collection block to improve prop passing

- Introduce ProductCollectionContentProps type for better prop management
- Refactor Edit component to use a renderComponent function
- Update component prop types to use more specific props
- Remove unnecessary props from ProductCollectionEditComponentProps
- Simplify component rendering logic in Edit component
- Adjust ProductPicker to receive only required props
- Update imports and prop types in various files to use new types

This refactoring improves code organization and reduces prop drilling by
only passing necessary props to each component. It enhances maintainability
and readability of the Product Collection block and related components.

* Refactor Product Collection block editor UI state handling

This commit simplifies the rendering logic in the Product Collection block's
Edit component. It removes a redundant case for the VALID state, as both
VALID and VALID_WITH_PREVIEW states now render the same ProductCollectionContent
component. This change improves code maintainability and reduces duplication.

* Fix: isDeletedProductReference is not set correctly

* Use "page.reload" instead of "admin.page.reload"

* Separate PRODUCT_REFERENCE_PICKER and DELETED_PRODUCT_REFERENCE cases

This improves readability and maintainability of the switch statement.

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-17 14:08:24 +05:30
Albert Juhé Lluveras 4ee2689f4f
Fix fatal when adding the Product Gallery (Beta) block into a pattern (#51189)
* Fix fatal when adding the Product Gallery (Beta) block into a pattern

* Add changelog file

* Linting
2024-09-17 09:49:53 +02:00
Moon 160b3e3ca7
Add use-wp-horizon feature flag (#51421)
* Add use-wp-horizon feature flag

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-16 21:02:21 -07:00
RJ 0036b4d293
add: tax task completion filter (#51362)
* add: tax task completion filter

* fix: add phpcs ignore for missing hook comment

* lint
2024-09-17 09:33:41 +08:00
Miguel Pérez Pellicer e4d995938f
Set customer email in reports data if available (#51367)
* Set customer email in reports data if available.

* Add changelog

* Lint
2024-09-16 22:45:47 +04:00
Boro Sitnikovski bf0646c307
Add error handling when the call to 'install-url' endpoint fails (#51298)
* Add error handling when the call to 'install-url' endpoint fails

* Changelog

* Ignore any explicitly

* Move the function below to address lint

* Change 'Try again' to a href, suggesting to download and install manually

* Lint
2024-09-16 16:57:05 +02:00
Tomek Wytrębowicz 450a299bae
Fix tax_code in the report export for removed rates (#51395) 2024-09-16 15:59:18 +02:00
Seghir Nadir 1ef1aaa1f0
Hadren styles for interactive elements in Checkout block (#51375)
* reset styles for panel button

* reset styles for address card edit and address line 2

* Update shipping selector buttons

* fix line height

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

* remove extra styles no longer needed

* update styles to balance chevron and change to span

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
2024-09-16 13:03:20 +00:00
Ivan Stojadinov cebdcc61d0
[e2e] External - Expand WPCOM suite, part 1 (#51303)
* Expand WPCOM suite

* Skip core-profiler.spec.js on WPCOM - no "Coming soon"

* Skip `Analytics-related tests` on WPCOM - different sums

* Skip `Marketing Overview page have relevant content` - no content on WPCOM

* Payment setup task - make Save button more unique

* Include more tests in playwright.config.js

* Skip `Store owner can skip the core profiler`

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

* Make "Get paid" more unique

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-16 13:56:44 +02:00
Seghir Nadir 77a17e48b7
update Mongolia postcode to be 5 digits instead of 6 in Checkout block (#50279)
* update Mongolia postcode to be 5 digits instead of 6

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

* update validation package and expand mongolia checks

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

* update lock

* fix lock again

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-16 11:22:38 +02:00
Narendra Sishodiya 63d93d7355
Implemented PHPCS Fixes in OrdersTableQuery.php and ProductQuery.php (#51281)
* Implemented PHPCS Fixes in OrdersTableQuery.php and ProductQuery.php

* Reverted gmdate() to date()

* Add changelog

* Fixed linting issue in Update OrdersTableQuery.php

---------

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
2024-09-15 16:21:55 +01:00
Fernando Marichal ae20724210
Add inspector controls to Product Search block (#51247)
* Add inspector controls to product search

* Add changelog

* Move inspector panel to Styles

* Remove not used Fragment

* improve code

* Rename enum

* Rename type ProductSearchBlockProps

* Use PositionOptions constant

* Change hook namespace
2024-09-13 18:52:12 -03:00
Barry Hughes 9b41815229
Produce CSV Import enhancements (cherry-pick PR#51344) (#51348)
* Move AJAX callback to produt importer controller

* Add better validation for file paths in CSV product import

* Add utility function to create a no-index directory

* Add CSV upload helper

* Simplify product CSV import logic using helper

* Update tests

* Add changelog

* Changelog.

* Remove changelog file; entry added directly to root changelog.txt.

---------

Co-authored-by: Jorge Torres <jorge.torres@automattic.com>
2024-09-13 11:39:37 -07:00
Tung Du 93053f39ed
[Experimental] Product Filters: New and improved blocks structure (#51096) 2024-09-14 00:04:06 +07:00
Cem Ünalan 3854f710df
In-App: make in-app header sticky (#51187)
* In-App: make in-app header sticky

z-index: 1 is required to make sure the header appears above product
cards.

Also had to remove a parent `overflow: hidden` property. Apparently,
it's there to remove a second scrollbar. Upon removal, I didn't see
any double scrollbars, although it can be platform differences. Will
check it out in the PR review.

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

* Update Change Your Store width for Marketplace search listing

Setting it 450px hardcoded causes overflows and breaks the layout.

See:
https://github.com/woocommerce/woocommerce/pull/51187#issuecomment-2344003169

* Move CYS tweak to the component

It was placed in the marketplace SCSS code previously. GitHub:
https://github.com/woocommerce/woocommerce/pull/51187#discussion_r1758381473

* Remove marketplace-specific styles from customize store banner

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Herman <KokkieH@users.noreply.github.com>
2024-09-13 15:55:47 +00:00
Miguel Pérez Pellicer 737afc62e1
Validate and prepare GTIN in structured data (#50926)
* Validate and prepare GTIN in structured data

* Add changelog

* PHPCS

* PHPCS

* Verify gtin is string in prepare gtin

* Tweak tests

* PHPCS

* Tweak is_valid_gtin

* LINT

* Update plugins/woocommerce/includes/class-wc-structured-data.php

Co-authored-by: Mik <mikkamp@users.noreply.github.com>

* Update plugins/woocommerce/includes/class-wc-structured-data.php

Co-authored-by: Mik <mikkamp@users.noreply.github.com>

* Update plugins/woocommerce/includes/class-wc-structured-data.php

Co-authored-by: Mik <mikkamp@users.noreply.github.com>

---------

Co-authored-by: Mik <mikkamp@users.noreply.github.com>
2024-09-13 19:11:11 +04:00
Fernando Marichal ce618d6250
[Enhancement] Abstract rating block (#50810)
* Create rating component

* Refactor rating block

* Fix ProductRating component

* Refactor rating blocks

* Add changelog

* Review count maybe visible for rating stars

* Rename props

* Remove 0 after No reviews message

* Remove review count from rating-stars
2024-09-13 09:35:56 -03:00
Seghir Nadir 348455fb02
Add focus styles for select in Checkout block (#51332)
* Add focus styles for select

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-13 11:13:40 +01:00
Seghir Nadir 1b28b0f1ca
Use site language when making Store API requests in Cart/Checkout (#51244)
* Use correct langauge by reseting the locale param

* use typescript
2024-09-13 11:42:21 +02:00
Karol Manijak 29ed02836a
Disable client-side nav in PC block when filters are inside (#51358)
* Disable client-side nav in PC block when filters are inside

* Add changelog

* Fix lint
2024-09-13 09:58:17 +02:00
Corey McKrill 9d76114472
Update Action Scheduler to 3.8.2 (#51353)
Co-authored-by: Néstor Soriano <konamiman@konamiman.com>
2024-09-13 09:37:13 +02:00
Basti 4dad4a9265
Fix: Version in mini-cart.php (#51020)
Co-authored-by: Néstor Soriano <konamiman@konamiman.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2024-09-13 08:51:31 +02:00
Vishnu Gopal 411d9ae78c
Add subscribe notices for products without subscription (#51060)
- Add a new notice to the plugins list for products used without subscriptions reminding them to purchase.
- Remove notices for expired and expiring subscriptions from WooCommerce settings screens.
- Change link for subscribe and renew to add the product directly to cart.

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-13 10:33:54 +05:30
RJ d7ccebc004
fix: add check for wp_get_current_user() before calling it (#51302)
* fix: add check for wp_get_current_user() before calling it

* changelog

* changed try catch to catch throwable
2024-09-13 12:44:28 +08:00
Sam Seay 268fc4cf4d
Fix a bug where the guest order confirmation email input was too wide (#51277)
* Add styles to style the input width appropriately.

* Remove redundant styles.

* Remove unused import

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-13 13:22:55 +12:00
Chi-Hsuan Huang 2cbb9d59bc
Deprecate unsupported Inbox note banner layout (#51275)
* Deprecate note banner layout

* Update doc

* Add changelog
2024-09-13 01:11:11 +00:00
Chi-Hsuan Huang f89366033d
Dynamically set plugin_name when redirecting to Jetpack Auth from core profiler (#51278)
* Dynamically set plugin_name when redirecting to Jetpack Auth from core profiler

* Add changelog

* Update param name
2024-09-13 08:34:17 +08:00
Chi-Hsuan Huang 45fc403f6f
Remove deprecated RemoteInboxNotification classes (#51250)
* Remove deprecated RemoteInboxNotification classes

* Derecate RIN interfaces

* Move RIN tests to remote specs folder

* Add changelog

* Update changelog

* Fix lint

* Fix lint

* Fix tests
2024-09-13 08:31:59 +08:00
RJ 109744db33
fix: remove help panel user meta (#51249) 2024-09-13 05:46:27 +08:00
Cem Ünalan 3300aef6c7
In-App Marketplace: Record the legacy Tracks event for Discover page (#51163)
* In-App Marketplace: Record the legacy Tracks event for Discover page

Fixes #21486

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-12 21:13:13 +00:00
Cem Ünalan 0e930533e9
Prevent search request in the Extensions > My Subscriptions page (#51164)
* Prevent search request in the Extensions > My Subscriptions page

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-12 20:36:58 +00:00
Maikel Perez f39e1d72c0
CYS: Fix Looker dashboard data (#51206)
* Track data for font and color pairings including 'Create your own' option in CYS

* Add changelog file

* Track data for logo flow

* Send the open param as part of the tracking event customize_your_store_assembler_hub_color_palette_create_toggle
2024-09-12 12:47:23 -03:00
Ivan Stojadinov a06c6ba496
[e2e] External sites - Include API tests for Pressable and WPCOM (#51284)
* Pressable - run only /api-tests

* Skip on Pressable

* Fix lint errors

* WPCOM - run API only

* Revert "WPCOM - run API only"

This reverts commit 5e59be1663.

* WPCOM - run API only

* Update settings-crud.test.js so they are passing against Pressable

* Skip "can retrieve all tax settings"

* Skip "can view all system status items" on WPCOM

* Several skips in settings-crud.test.js

* Skip "Product review tests: CRUD" on WPCOM

* Skip "List all products > categories" on WPCOM

* Skip "can view all payment gateways" on WPCOM

* Skip "Orders API tests" on WPCOM

* Skip "Customers API tests: CRUD" on WPCOM

* Revert `playwright.config.js` files and include '**/api-tests/**/*.test.js',

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

* Skip three more API tests for WPCOM

* Skip two coupons tests

* Update report name for Pressable and WPCOM to ``*-core-e2e-and-api`

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-12 16:01:40 +02:00
Ilyas Foo 3dc0d69091
Re-enable remote logging feature by default (#51320)
* Reenable remote logging feature by default

* Changelog
2024-09-12 21:36:08 +08:00
Raja sekar 97182ef9ca
Changes to IAM footer (#51315)
* add max-width and border raidus to footer container
- to make it look similar to design your own theme box

* remove marketplace copy from footer

* add another tab to footer

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

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

* add feedback on code

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-12 18:28:48 +05:30
Raja sekar 358bc1fee2
Make padding consistent and remove bottom margin for for all types of product cards (#51288)
* Make padding consistent for all type of card contents as 24px

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

* override margin bottom added by woo payments plugin for product cards

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-12 17:44:25 +05:30
github-actions[bot] c7c054d8f8
Delete changelog files based on PR 51312 (#51319)
Delete changelog files for 51312

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-12 19:03:04 +07:00
Mike Jolley b0401ef25d
[Experimental] Delayed Account Creation Block (#50934)
* Add block to templates

* Register block type with php

* Create block type class

* Update webpack

* Move password strength meter component

* Add button styles when disabled

* Move password strength component

* Block WIP

* CSRF token handling

* Put new block behind feature flag

* Add experimental flag docs

* Update icon + description

* Changelog

* Lint errors

* Style controls

* Adjust icon markup

* subsctring match

* More specific import

* Fix test fail caused by layout shift

* Wording changes from Figma

* Check if logged in, not just if the current email is registered

* Use opacity for disabled button text

* Sync order data with customer after account creation

* Add id/fragment to form
2024-09-12 11:18:13 +01:00
Ilyas Foo 7eb31840e7
Disable remote logging feature by default (#51312)
* Disable remote logging feature by default

* Changelog
2024-09-12 18:12:29 +08:00
Chi-Hsuan Huang 56c04f2bfb
Fix unsnooze notes not working (#51254)
* Fix saving note timestamp

* Fix missing wc_admin_unsnooze_admin_notes action

* Add changelog

* Update tests
2024-09-12 09:14:25 +00:00
Miguel Pérez Pellicer c96f9f38bd
Reduce slow reports tests (#51279)
* Fix slow tests

* Lint

* Changelog

* Lint

* Lint
2024-09-12 13:07:28 +04:00
Karol Manijak ed9742f18b
Skip failing tests from experimental Product filters feature (#51305)
* Skip failing tests from experimental feature

* Add changelog
2024-09-12 10:37:51 +02:00
Roy Ho 41cf2b285e
[Experimental] Product filters/overlay nav block redesign (#51211)
* Remove overlay icon settings from parent block

* Change overlay block icon to generic button icon

* Add logic to remove overlay nav when overlay mode is set to never

* Add logic to add overlay nav when overlay mode is not never

* Add default attributes for overlay nav button

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

* Use unique icons for each overlay navigation close and open

* Add icon picker for open overlay navigation

* Add trigger type for overlay close navigation

* Add missing settings label

* Fix e2e tests

* Skip a test for overlay-navigation block

* Add e2e tests for overlay button behavior

* Fix linting error

* Skip overlay nav tests

* Fix icon size value not saving

* Revise logic to target explicitly the innerblock of product-filters

* Ensure overlay navigation is of type open-overlay

* Prevent possible race conditions

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-11 12:11:51 -07:00
Adrian Moldovan 0c8a8bd6cf
[e2e tests] Fix flakiness and refactor create-order spec (#51292) 2024-09-11 21:10:00 +03:00
Adrian Moldovan 0e2258b57d
[e2e tests] Fix flaky test and refactor admin-tasks payment spec (#51269) 2024-09-11 10:32:18 -07:00
Mike Jolley d87c3d38d7
Performance: Move collectableMethodIds to cart/checkout block assets rather than loading it sitewide (#51174)
* Move collectableMethodIds to cart/checkout block assets

* changelog
2024-09-11 16:25:20 +01:00
github-actions[bot] d4cc6578c7
Delete changelog files based on PR 51289 (#51294)
Delete changelog files for 51289

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-11 21:48:29 +07:00
Alexandre Lara 0b16cfa06a
[Experimental] Product Filters Redesign > Overlay: Add Fullscreen view (#50505)
* Add variation to Product Filters Overlay Navigation

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

* Move Product Filters Overlay Navigation to correct position

* Hide block when it is outside the Product Filters template part

* Display Navigation block in the frontend

* Show the Product Filters Overlay Navigation on the frontend

* Add logic to hide Product Filters Overlay Navigation block on the frontend

* Hide block on the Overlay template part

* Fix eslint errors

* Update the block variation title

* Remove the `isActive` property from the block variations

* Use Product Filters block context

* Replace enum with const

* Remove unnecessary `StyleAttributesUtils`

* Rename context key

* Move BlockOverlayAttribute to the constants.ts file

* fix BlockOverlayAttribute import

* Fix import error

* Improve code for the shouldHideBlock method

* Remove unnecessary attributes property

* Fix error in ProductFiltersOverlay block

* Add dialog to the Product Filters block

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

* Fix interactivity api error

* Prevent block from being hidden on Product Filters template part

* Fix inspector controls when block is hidden

* Add clickable action to the Product Filters Overlay Navigation block

* Fix interactivity directives that were not working for the Overlay

* Fix issue with dialog styles not being correctly applied

* Add the `closeDialog` functionality

* Parse and render blocks for the Product Filters overlay

* Fix padding

* Fix style for Product Filters Overlay navigation block

* Add e2e test

* Add e2e test to Product Filters Overlay template part

* Fix e2e test

* Fix issue causing the trigger button to show even though the overlay mode is set to 'Never"

* Fix issue causing close button to not be displayed in the dialog

* Add e2e tests

* Fix issue that was preventing users from scrolling down the dialog content

* Remove text duplication in e2e tests

* Remove unnecessary imports

* Fix php cs errors

* Fix php cs error

* Revert changes on Product Gallery modal styles

* Fix lint errors

* fix php cs lint errors

* fix php cs error

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-11 11:30:35 -03:00
Seghir Nadir 96497814e4
Revert update to createRoot in Checkout block. (#51289)
* Revert "[React 18] Use `createRoot().render()` instead of `render()` (#48843)"

This reverts commit 752273e6ce.

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-11 13:44:09 +00:00
Fernando Marichal e4f03589ab
Deprecate single product block save (#51153)
* Add deprecated save

* Fix button styles

* Add changelog

* Add attributes to deprecated prop

* Add supports prop to deprecated obj

* Add code comment
2024-09-11 09:54:43 -03:00
Chi-Hsuan Huang b728f53f29
Fix duplicate spec evaluation in `evaluate_specs()` (#51166)
* feat: Add memoization to EvaluateSuggestion class

This commit adds memoization to the `EvaluateSuggestion` class in order to improve performance by caching the results of the `evaluate_specs` method. The memoization is implemented using an associative array called `$memo`, which stores the results of previous evaluations based on the input specifications and logger arguments. The memoization logic checks if the results for a given set of specifications and logger arguments already exist in the `$memo` array, and if so, returns the cached results instead of re-evaluating the specs. This helps to avoid redundant computations and improves the overall efficiency of the `evaluate_specs` method.

* Add changelog

* Only use specs as key

* Move shipping test to correct folder

* Fix tests

* Fix tests

* Fix lint

* Address PR feedback
2024-09-11 08:13:48 +00:00
Chi-Hsuan Huang 007bd21a35
Clean up purchase task (#51274)
* Remove Purchase task

* Add changelog
2024-09-11 15:39:28 +08:00
Chi-Hsuan Huang 057e118a34
Fix size for coming soon banner login button (#51251)
* Fix coming soon banner login button style

* Add changelog
2024-09-11 13:47:02 +08:00
Tomek Wytrębowicz 065470dea8
Use `get_filtered_ids` consistently in `taxes` and `…/stats` datastores (#51219) 2024-09-10 23:17:10 +02:00
Álvaro Thomas be79bcca84
E2e Tests Order Copying Billing Shipping Address (#50131)
* Update order edit tests with shipping address tests

Update order edit tests with shipping address tests

* Add changelog

* Refactor new tests

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-09-10 23:13:54 +03:00
Adrian Moldovan d409d6db99
[e2e tests] Don't catch api errors in fixtures (#51265) 2024-09-10 10:32:41 -07:00
Boro Sitnikovski da7cf716d8
Add chevron after See more to the list header (#51199)
* Add chevron after See more to the list header

* Changelog

* Correct changelog path

* Alphabetically ordered imports :)
2024-09-10 18:28:31 +02:00
Adrian Moldovan 70716d1a6a
[e2e tests] Fix flaky product images test: can update a product gallery (#51263) 2024-09-10 09:16:52 -07:00
DAnn2012 b72e07c605
Fix typos (WooCommrece) (#50333)
* Update README.md

* Update 722.md

* Update 741.md

* Update docs-manifest.json

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Roy Ho <roykho77@gmail.com>
2024-09-10 08:15:36 -07:00
Adrian Moldovan 31a2474c3b
[e2e tests] Fix flaky test create-variable-product-block-editor > can create a variation option and publish the product (#51246) 2024-09-10 14:51:45 +02:00
Vladimir Reznichenko 9fd4b54902
PHPUnit: report slow tests. (#51253)
Enables reporting slow PHPUnit tests as part of testing [progress output.
2024-09-10 12:37:23 +02:00
Herman d53c5a2222
Fix in-app product card descriptions (#51228)
* Add classname to description section for business service card

* Decode HTML entities in product descriptions

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Raja sekar <raja.sekar.manimaran@automattic.com>
2024-09-10 12:55:24 +05:30
Herman 904dfaa2ff
Set in-app product card price meta dynamically (#51170)
* Set product card price currency and suffix dynamically based on endpoint data

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

* Remove unnecessary comment

* Update types to match data received from WCCOM after further changes to the API

* Apply suggestions from code review

Allow for future currencies that might switch the symbol/value order

Co-authored-by: Dan Q <dan@danq.me>

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Dan Q <dan@danq.me>
2024-09-10 06:57:52 +00:00
Herman 3b35e22c99
Update in-app product card clicked Tracks event (#51180)
* Add product and group id properties to Tracks data for product card clicks

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

* Update product tracksproperty to product_id

Co-authored-by: And Finally <andfinally@users.noreply.github.com>

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: And Finally <andfinally@users.noreply.github.com>
2024-09-10 08:33:12 +02:00
Chi-Hsuan Huang 7dc26a8c66
Clean up 'Profile Wizard' code (#51190)
* Remove plugins/woocommerce-admin/client/profile-wizard

* Clean up styles

* Remove setup wizard hook reference

* Add changelog

* Remove e2e utils related to old setup wizard

* Fix lint

* Add changelog

* Remove unused usage modal
2024-09-10 11:29:14 +08:00
Vedanshu Jain e85869f3a4
Add phone to searchable FTS fields for order addresses. (#51065)
This PR adds the phone number to the FTS index on the order address table, and adds the migration routines so that we can recreate the index for shops that already have this enabled. Additionally, it also removes support for relevancy operators to make search performant.

Fixes #51213
2024-09-09 16:20:25 -07:00
Adrian Moldovan 0645a0326d
[k6 tests] Manage K6 version (#51239) 2024-09-09 21:29:09 +02:00
Matthew Reishus a8b42b3ce3
Blocks\Assets\Api: Do not attempt to update script_data transient with the same data (#50962)
* Blocks\Assets\Api: Do not attempt to update script_data transient with the same data

* Add changelog

* Update plugins/woocommerce/src/Blocks/Assets/Api.php

Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>

* Update plugins/woocommerce/changelog/50962-dont-update-transient-with-same-data

Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>

---------

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>
2024-09-09 16:59:58 +01:00
Vlad Olaru b40c4a95e5
Attach WooPayments incentive ID to wcadmin_tasklist_click Tracks event props (#51105)
* Add WooPayments incentive ID to task additional data

* Attach WooPayments incentive ID to wcadmin_tasklist_click Tracks event

* Add changelog

* Add changelog

* Replace short array syntax

* docs: Update docs
2024-09-09 18:06:43 +03:00
louwie17 0e8d19d43b
Upgrade storybook to version 7 and add pages workflow for GH publishing (#51168)
* Updated storybook and renamed stories to use the *.story.js/tsx format

* Renamed stories within product editor and wc admin package

* Include *story files in product editor package

* Add storybook pages workflow

* Remove the 'on' param in storybook-pages

* Add changelogs

* Fix failing tests

* Add dirname for any other webpack configs that rely on the woocommerce-admin one

* Fix React 18 warnings

* Remove unneeded storybook packages from components package

* Remove storybook workflow, to be added as a follow up instead

* Revert @storybook/react back to fix unit tests
2024-09-09 12:06:01 -03:00
David Marín 7f89cd5090
Using new coupon_info metadata, if it exists, to determine the actual coupon id (#48262)
* Using new coupon_info metadata to determine the actual coupon id

Changes to make use of the new coupon_info meta data, if it exists, to determine the actually-used coupon.

If coupon_info meta data doesn't exist, I'm also adding an extra filter so, in case there are more than one active coupons with the same name, we filter out the ones that were created after the order.

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Néstor Soriano <konamiman@konamiman.com>
2024-09-09 17:00:37 +02:00
Thomas Roberts 72112bd5d4
Update shipping calculator wording and Cart/Checkout order summary title (#51072)
* Update isAddressComplete to allow only specific fields to be checked

* Update tests for isAddressComplete

* Update wording on "enter address" prompt in Cart sidebar

* Update Shipping to Delivery in cart & checkout shipping total

* Only check the city, state, country, & postcode fields in shipping calc

* Update wording in the "Ships to" section of cart/checkout sidebar

* Update shipping calculator button to say delivery

* Update tests to use new strings

* Remove test that was falsely passing anyway

This test checked for presence of a string that wasn't in the codebase. It also doesn't seem like a valid test. Why would we want to remove the button just because default rates are available?

* Add changelog

* Left align text in shipping calculator button

It floats weirdly in the middle with the new text changes

* Update text in tests

* Update wording in unit tests

* Update shipping calculator text in test

* Update shipping text in test

* Update use of shipping in tests

* Skip test with no translation available

* Lint fixes

---------

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2024-09-09 15:19:57 +02:00
DAnn2012 acdf296215
Fix typo (wc-update-functions.php) (#50146)
* Update wc-update-functions.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-09-09 12:15:19 +00:00
Herman b913931623
Remove title for Extensions and Themes tabs (#51195)
* Remove title for Extensions and Themes tabs

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Dan Q <dan@danq.me>
2024-09-09 14:08:49 +02:00
Vladimir Reznichenko 8dcb562c39
[dev] PSR-4 naming fixes in tests (part 2) (#51198)
In this PR we address PSR-4 naming-related violations (class FQN vs path mismatches and co) in tests.
2024-09-09 11:26:55 +02:00
Vladimir Reznichenko 199883a05a
[dev] PSR-4 naming fixes in tests (part 1) (#51194)
In this PR we address PSR-4 naming-related violations (class FQN vs path mismatches and co) in tests.
2024-09-09 10:37:30 +02:00
RJ 86c2358d18
dev: refactor xstate update query params made generic (#51167)
* refactor: make updateQueryParam generic

* changelog
2024-09-09 10:49:40 +08:00
Jonathan Lane 43cc912bba
Select bank transfer explicitly on customer payment page e2e test (#51210)
Select bank transfer explicitly

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-09-06 20:24:44 +00:00
Adrian Moldovan 36f85ef0c6
[e2e tests] Fix flakiness in page publishing action (#51196) 2024-09-06 11:34:51 -07:00
Veljko V. b71e6e22a8
[e2e] External sites - update /shopper tests, part 1 (#51068)
* Update shopper tests and util to fix external env compatibility

* Update WPCOM config to include shopper tests and skip one from testing

* Update WPCOM config

* Update shopper shop title deletion test to avoid false positives

* Add search and click steps to afterEach

* Update selector in test to pass across all envs

* Update external PW configs for shopper tests

* Improve existing test to use WP API for setup

---------

Co-authored-by: Ivan Stojadinov <ivan.stojadinov@automattic.com>
2024-09-06 15:34:45 +02:00
Roy Ho 63243c57a9
[Experimental] Product filters > Attributes loading state in editor (#51151)
* Fix no products component prematurely being rendered

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

* Use useMemo to memoirize component element on re-renders

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-06 05:33:02 -07:00
Ivan Stojadinov a61a2bd29e
[e2e tests] External sites - update /merchant tests, part 4 (#51181)
* Skip `WooCommerce woo.com Settings`

* Make `Update` button more unique

* Run entire /merchant folder

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-06 11:27:45 +02:00
Chi-Hsuan Huang 19661e3317
Refactor Country Specs to use in operator (#51162)
* Refactor Country Specs to use in operator

* Add changelog

* Refactor shipping specs
2024-09-06 15:45:49 +08:00
Ilyas Foo b4f1062783
Update coming soon docs to include more extensibility examples (#51160)
* Update docs

* Small update

* Changelog

* Lint

* Docs manifest

* Add store pages extensibility

* Docs manifest

* Update docs/extension-development/integrating-coming-soon-mode.md

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

---------

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2024-09-06 14:38:59 +08:00
Ian Yu-Hsun Lin 43ce3c1c4d
[WC Analytics] Add filters for custom orderby query params (#49722)
* Add a filter `woocommerce_report_categories_orderby_params` for custom orderby query params

* Add a filter `woocommerce_report_coupons_orderby_params` for custom orderby query params

* Add a filter `woocommerce_report_coupons_stats_orderby_params` for custom orderby query params

* Add a filter `woocommerce_report_customers_orderby_params` for custom orderby query params

* Add a filter `woocommerce_report_downloads_orderby_params` for custom orderby query params

* Add a filter `woocommerce_report_downloads_stats_orderby_params` for custom orderby query params

* Add a filter `woocommerce_report_orders_orderby_params` for custom orderby query params

* Add a filter `woocommerce_report_orders_stats_orderby_params` for custom orderby query params

* Add a filter `woocommerce_report_products_orderby_params` for custom orderby query params

* Add a filter `woocommerce_report_products_stats_orderby_params` for custom orderby query params

* Add a filter `woocommerce_report_revenue_stats_orderby_params` for custom orderby query params

* Add a filter `woocommerce_report_stock_orderby_params` for custom orderby query params

* Add a filter `woocommerce_report_taxes_orderby_params` for custom orderby query params

* Add a filter `woocommerce_report_taxes_stats_orderby_params` for custom orderby query params

* Add a filter `woocommerce_report_variations_orderby_params` for custom orderby query params

* Add a filter `woocommerce_report_variations_stats_orderby_params` for custom orderby query params

* Add changelog

* Add a method `apply_custom_orderby_filters()` in analytics GenericController

* Use the shared method to in analytics GenericController to apply custom
orderby enum

* Fix typo, add more comments in analytics custom orderby filter PHPDoc

---------

Co-authored-by: Tomek Wytrębowicz <tomalecpub@gmail.com>
2024-09-06 12:13:03 +08:00
Chi-Hsuan Huang cb2549386a
Only run "woocommerce_admin_shared_settings" filter on admin requests (#51161)
* Only load settings if it's admin

* Add changelog
2024-09-06 11:44:01 +08:00
Chi-Hsuan Huang 0ef7d95aff
Hide site visibility badge when "Launch Your Store" feature is disabled (#51159)
* Fix: put site visibility badge behind the launch your store feature flag

* Add changelog
2024-09-06 10:39:55 +08:00
George Jipa a7b957dbce
Fix `Customers\DataStore::anonymize_customer` use of WC_Order instance as int (#38201) 2024-09-05 21:56:48 +02:00
Adrian Moldovan 61d41adf79
[k6 tests] Fix broken perf tests - updated page titles (#51173) 2024-09-05 10:53:00 -07:00
Boro Sitnikovski d2fb60a5d1
Change label `Browse` to `Extensions` (#51140)
* Change label `Browse` to `Extensions`

* Changelog
2024-09-05 17:11:42 +02:00
Karol Manijak a7231863c0
Product Collection: Trigger `wc-blocks_viewed_product` JS event (#51156)
* Define the event

* Add action sending an event in PC store

* Add directives and context to Product Template li element

* Use on--click directive in ProductImage

* Use on--click directive in Product Title

* Use on--click directive in Product Button

* Add changelog

* Add E2E tests

* Update docs

* Update blocks reference and docs manifest

* Update m,anifest

* Fix mistake in docs

* Regenerate docs manifest

* Fix lint

* Extractb new tests to a separate file
2024-09-05 12:52:35 +02:00
Ivan Stojadinov 5a5b1f0478
[e2e tests] External sites - update /merchant tests, part 3 (#51158)
* Skip `Merchant can view a list of all customers, filter and download`

* Skip `can receive new order email`

* Expand Pressable run with new set of /merchant tests

* Move `should filter by All` into for loop with existing tests

* Wait between two actions with `networkidle`

* Skip two tests on Pressable

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

* Remove `networkidle` and use class `current` for the selected filter

* Fix ESLint error

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-05 11:19:23 +02:00
Ivan Stojadinov ccd5669c21
[e2e tests] External sites - update /merchant tests, part 2 (#51016)
* Handle error for api.delete( coupons/<id> )

* Choose any product that contains "product" in its name

* Expand Pressable test suite

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

* Add missing `throw` error

* Make product name more unique with `Date.now()`

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-05 10:56:48 +02:00
RJ dcbc4dc588
dev: update webpack build to dynamiclly fetch wp-admin-scripts (#51133)
* dev: update webpack build to dynamiclly fetch wp-admin-scripts

* Update README.md

* Update README.md
2024-09-05 00:14:32 +00:00
Veljko V. 18ab90badd
[e2e tests] External sites - update /shopper tests, part 2 (#51100)
* Update shopper tests, external config and add tags

* Update WPCOM config to include shopper tests
2024-09-04 22:09:04 +02:00
Ivan Stojadinov a5623099dd
[e2e] Move Pressable and WPCOM to release checks instead of daily checks (#51148)
* Move Pressable and WPCOM to release checks instead of daily checks

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-04 21:53:59 +02:00
piinthecloud 0ea76c2ffb
fixes and updates (#51144)
* fixes and updates

* add changelog

* update quotes

* fix broken whitespace

* Update plugins/woocommerce/changelog/update-contrib-docs-and-fixes

Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>

---------

Co-authored-by: Jacklyn Biggin <hi@jacklyn.dev>
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
2024-09-04 17:11:35 +00:00
github-actions[bot] 0f2fa403f1
Delete changelog files based on PR 51081 (#51107)
Delete changelog files for 51081

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-04 09:42:18 -07:00
github-actions[bot] 8f3e824596
Delete changelog files based on PR 51067 (#51084)
Delete changelog files for 51067

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-04 09:42:00 -07:00
github-actions[bot] 941f85bb77
Delete changelog files based on PR 50970 (#51093)
Delete changelog files for 50970

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-04 09:41:53 -07:00
Tom Cafferkey 6bf6f32854
CYS: Replace Nokul theme with Gizmo (#51113)
* Replace Nokul theme with Gizmo in the CYS experience since it was retired
2024-09-04 14:34:00 +01:00
Tom Cafferkey c074c5580b
PTK: Check if theres a scheduled action before logging warning. (#51143)
* Check if there is a scheduled action before logging warning
2024-09-04 13:23:20 +00:00
Roy Ho b618f81c6d
[Experimental] Product filters - ensure we can add multiple instances (#51051)
* Product filters ensure we can add multiple instances

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

* Add e2e tests to ensure multiple filters can be added

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-04 05:39:07 -07:00
Gabriel Manussakis f93a05c467
[Accessibility] Add endpoint title to the document title (#50900)
* Add endpoint title to the document title

* Add changelog file

* Ignore phpcs NonceVerification
2024-09-04 10:22:21 +01:00
Gabriel Manussakis f8677c45d1
[Accessibility] Provide screen readers with product sorting status message (#50573)
* Update result-count template to display orderby message

* Update result count live region if products are sorted

* Bump result-count template version

* Remove additional full stop.

* Fix docblock spacings

* Remove jQuery code from sort by live region logic

* Validate filter result type

---------

Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
2024-09-04 08:31:08 +01:00
Chi-Hsuan Huang 19aac5f6fb
Delete changelog files based on PR 51013 and 51046 (#51128)
Delete change logs for 51013 and 51046
2024-09-04 10:39:24 +08:00
Ivan Stojadinov 0d65648ed7
[e2e] Skipping 11 tests for the Pressable website (#51123)
* Skipping 11 tests for the Pressable website

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Jonathan Lane <lanej0@users.noreply.github.com>
2024-09-03 21:53:23 +00:00
Adrian Moldovan 881fd73847
[e2e tests] Fix restricted coupons tests - wait for animation to finish (#51121) 2024-09-03 14:29:07 -07:00
github-actions[bot] 1e4b34cad8
Delete changelog files based on PR 51075 (#51118)
Delete changelog files for 51075

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-03 14:04:43 -07:00
Adrian Moldovan 03a69eca0b
[api tests] Isolate test context for fix flakiness in product crud api tests (#51116) 2024-09-03 13:58:17 -07:00
Christopher Allford caf9ec635e
Use PHP 7.4 for WooCommerce Blocks' `wp-env` Config (#51075)
This resolves a PHP 7.4 compatibility problem as well as updates the `wp-env` config for the Blocks tests to use 7.4 rather than the latest.
2024-09-03 09:54:22 -07:00
Adrian Moldovan c656fdc59b
[e2e tests] Clean up created test products in product edit tests (#51112) 2024-09-03 18:02:58 +02:00
Gabriel Manussakis 57ef5a884e
[Accessibility] Improve Checkout block page accessibility after removing heading level 1 (#50925)
* Add aria-label to checkout form landmark

* Remove aria-hidden from checkout form sub-titles

* Add aria-label to checkout form

* Add changelog file

* Remove aria-hidden from form-step snapshots

* Bump form-checkout template version
2024-09-03 15:42:28 +01:00
louwie17 82a00a56e5
Remove usage of team specific names within PHP unit tests (#51017)
* Change team names in tests to generic names

* Add changelog
2024-09-03 10:29:45 -03:00
Mike Jolley a7f29ce98e
Consolidate Store API and Core account creation handling (#50913)
* Consolidate Store API and Core account creation handling

* Changelog

* Add hook doc

* Update tests to not use global settings

* Ignore lints for other hooks in file
2024-09-03 13:42:51 +01:00
Mike Jolley bdf8f2b1a4
[Flaky Test] Wait for response across all requests, including on the checkout page (#51048)
* Wait for response across all requests, including on the checkout page

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

* Update Docblock

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-03 11:22:19 +01:00
Sam Seay 115d4f16c9
Remove the wc combobox component, it is no longer used (#50975) 2024-09-03 09:20:46 +00:00
Paul Sealock bf7e81de8e
[Legacy Settings] Enable Save button on pages with tables (#51102) 2024-09-03 18:39:38 +12:00
RJ 258ae0b03b
add: remote logger request uri sanitisation (JS) (#51046)
* add: remote logger request uri sanitisation

* md lint

* Update packages/js/remote-logging/README.md

Co-authored-by: Paul Sealock <psealock@gmail.com>

* pr feedback

---------

Co-authored-by: Paul Sealock <psealock@gmail.com>
2024-09-03 05:42:03 +00:00
Chi-Hsuan Huang c1f9a73af1
Fix badge number fails to match the number of unfinished tasks (#51063)
* Update core profiler layout options

* Add changelog

* Disable footer
2024-09-03 13:38:00 +08:00
Ilyas Foo 4680b3dcfb
Add a check to make themes API query safer (#51081)
* Add check to ensure themes API is safe

* Changelog

* Lint

* Add more checks for malformed data
2024-09-03 13:01:32 +08:00
Adrian Moldovan 0be7e3deb0
[e2e tests] Fix linked products flaky test (#51099) 2024-09-03 04:53:32 +00:00
Paul Sealock cfcf074886
[Settings] Update feature flag usage (#50977) 2024-09-03 12:45:48 +12:00
Sam Najian 8b35b0785c
Update woocommerce shipping promo banner [wc-shipping-188] (#50970)
* Make sure the WC Shipping slug is used for installation

* Make sure the check to show banner metabox work for HPOS as well

* Make ShippingLabelBannerDisplayRules::order_has_shippable_products work with HPOS as well

* Remove Jetpack plugin specific checks in ShippingLabelBannerDisplayRules

* Use correct variable names for dotcom connection

* Fix comments

* Remove depenency on WCS&T for showing WC Shipping promo banner

* Remove WC Tax and WC Shipping from incompatible plugins

* Vary action button label if WCS&T is already installed

* Inject config and render label purchase app after activation

* Open the purchase modal after adding it to DOM

* Render Shipment tracking metabox

* Use a different headline when WCS&T is already installed

* Fix UX when a none-compatible WCS&T is already active

* Fix CSS linting issues

* Fix Jslint issues

* Improve around usage of localized variables

* Fix and update JS tests

* Address phpcs issues

* Delete metaboxes of compatible WCS&T

* Remove redundant variable assignment

* Remove css and js of WCS&T if a compatible version is installed

* Fix failing legacy PHPUnit tests

* Only open the new label purchase modal if WCS&T is not active

* Remove redundant code around TOS acceptance for showing the banner

* Remove redundant test for Jetpack version checking

* Make sure target passed to MutationObserver.observe is available

* Add changelog file

* Add openWcsModal to component's prototype

* Add more js unit tests

* Address PHP notice

* Remove redundant variable assignments

* Rename wcsPluginSlug to more clear wcShippingPluginSlug

* Add a link to plugins page if incompatible WCS&T is already installed

* Remove unused function parameters

* Fix API resource path

* Handle a case where none compatible version of WCShipping is installed
2024-09-02 14:23:52 +02:00
Adrian Moldovan 74e96d689b
[e2e tests] Tag some e2e tests to help with test audit (#51044) 2024-09-02 12:09:56 +02:00
Albert Juhé Lluveras 0f7773dd47
Fix My Account block icon being too small when inserted via block hooks (#51047)
* Fix My Account block icon being too small when inserted via block hooks

* Add changelog file
2024-09-02 09:40:47 +02:00
Manish Menaria 2433664aa8
Product Collection - Show product picker in Editor when collection requires a product but it doesn't exist (#50164)
* Show product picker control in the editor when a product context is required but not provided

Enhanced the Product Collection block by introducing the `selectedReference` attribute and implementing a product picker control. This control appears in the editor when a product context is required but not provided in the current template/page/post.

1. **block.json**: Added `selectedReference` attribute of type `object`.
2. **constants.ts**: Included `selectedReference` in the `queryContextIncludes` array.
3. **EditorProductPicker.tsx**: Created a new component for selecting products within the editor.
4. **editor.scss**: Added styles for the new Editor Product Picker component.
5. **index.tsx**: Updated logic to determine the component to render, incorporating the new Editor Product Picker.
6. **types.ts**: Defined types for `selectedReference` and updated `ProductCollectionAttributes` interface.

This enhancement allows merchants to manually select a product for collections that require a product context, ensuring the block displays correctly even when the product context is not available in the current template/page/post.

- **Product Picker Control**: Utilizes the existing `ProductControl` component for selecting products. This component is displayed in the editor when a collection requires a product context but it doesn't exist in the current template/page/post.

* Update label on ProductControl component

* Implement dynamic UI state management for product collection block

- Introduced `ProductCollectionUIStatesInEditor` enum to define various UI states for the product collection block.
- Added `getProductCollectionUIStateInEditor` utility function to determine the appropriate UI state based on context.
- Updated `Edit` component to use `getProductCollectionUIStateInEditor` for dynamic state management.
- Refactored `ProductCollectionContent` to utilize the new Editor UI state management.

* Fix: Product picker isn't showing

* Fix: Preview label state isn't showing

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

* Refactor WooCommerceBlockLocation type

- Introduced specific interfaces for WooCommerceBlockLocation, including ProductLocation, ArchiveLocation, CartLocation, OrderLocation, and SiteLocation, to improve type safety and code clarity.
- Updated createLocationObject function to return a BaseLocation type.
- Refactored useSetPreviewState hook in product-collection utils:
  - Extracted termId from location.sourceData for cleaner and more readable code.
  - Replaced direct access of location.sourceData?.termId with termId variable.

* Remove fallback to 0 in case there may be a product with id 0

* Use optional chaining to avoid undefined errors

* Rename  to

* Change order of arguments in  function

* Pass boolean prop instead of making further recognition of the UI state in ProductCollectionContent

* Destructure  props in  component

* Rename  to

* Update names in  enum

* Rename  to  and change the structure to single number.

* Rename location to

* Add a method to choose a product in the product picker in Editor

* Add E2E tests

* Fix failing e2e tests by changing location to productCollectionLocation

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

* Don't allow selecting product variations

* Minor code refactoring

* Fix: Product control isn't showing products

**Before**
```tsx
const getRenderItemFunc = () => {
		if ( renderItem ) {
			return renderItem;
		} else if ( showVariations ) {
			return renderItemWithVariations;
		}
    return () => null;
	};
```

As you can see above, `return () => null;` is returning a function which is causing the issue. This will render nothing in the list. I changed this to `return undefined;`. This way, we will use default render item function.

* Translate text in ProductPicker component

* Improve E2E test

* Use createInterpolateElement to safely render strong HTML tag

* Fix E2E tests

* Fix E2E tests

* Product Collection: Inspector control to change selected product (#50590)

* Add Linked Product Control to Product Collection Block Inspector Controls

- Introduced a new `LinkedProductControl` component in the Product Collection block's Inspector Controls.
- This control allows users to link a specific product to the product collection via a dropdown with a search capability.
- Added corresponding styles to `editor.scss`.
- Integrated a `useGetProduct` hook in the `utils.tsx` to fetch and manage the state of the linked product data, including handling loading states and errors.
- Updated the Inspector Controls to include the new Linked Product Control component, enhancing the block's customization options for users.

* Add E2E tests

* Hide product picker when product context is available

* Improve logic to hide Linked Product Control

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

* Remove hasError state from useGetProduct hook

* Rename isShowLinkedProductControl to showLinkedProductControl

* Convert jsxProductButton to ProductButton component

* Refactor jsxPopoverContent to LinkedProductPopoverContent component

* Improve UI of Linked Product Control

* Address PR feedback

* Fix E2E tests

---------

Co-authored-by: github-actions <github-actions@github.com>

* Rename isUsesReferencePreviewMode to isUsingReferencePreviewMode

* Change order of conditions in getProductCollectionUIStateInEditor

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-02 12:39:33 +05:30
RJ 36ede651db
add: sanitise query params in remote logging (PHP) (#51013) 2024-09-02 12:38:22 +08:00
Fernando Marichal 3def18623e
Fix variation selector display issues on the front end (#51023)
* Add woocommerce class to single-product

* Add changelog

* Fix chevron alignment
2024-08-30 17:47:20 -03:00
Seghir Nadir dec89a1311
Revert "Store API: Do not resume orders with `pending` status (#50531)" (#51067)
* Revert "Store API: Do not resume orders with `pending` status (#50531)"

This reverts commit 3170acd1b0.

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-30 18:24:53 +01:00
louwie17 2890e16c86
Add product data views list to experimental product data views page (#51008)
* Add products data views list

* Add navigation on the left

* Update edit site package

* Fix styling

* Add changelog

* Add wp/icons package to syncpack exception list

* Delete some unused stuff and address types

* Add changelog

* Remove un needed css

* Remove dependency on edit-site package

* Fix custom status filters

* Make sure page size works with view config

* Remove use of canvasMode and navigation context as it is not needed

* Remove wordpress/dom from syncpack
2024-08-30 13:27:10 -03:00
Albert Juhé Lluveras e589fa87e1
CYS: Mark several classes as internal (#51069)
* CYS: Mark several classes as internal

* Add changelog file
2024-08-30 16:59:28 +02:00
Alba Rincón 502b4abe43
Fix increasing & decreasing sale price in product bulk edit (#50842)
* 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

* Avoid setting the price to 0 when there wasn't a previous sale

* Move the WC_Tests_Admin_Post_Types test to the appropiate folder so it's run

* Add e2e test

* Add e2e test

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

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

* Fix lint errors

* Fix lint errors

* Fix test

* Fix lint errors

* Revert mv

* Address increasing sale from 0

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-30 14:40:05 +02:00
Chi-Hsuan Huang 7971df1d28
Enhance WooCommerce version checking for remote logging reliability (#51009)
* Enhance WooCommerce version checking using get_plugin_updates()

* Update remote logger tool to toggle remote logging feature properly

* Add changelog
2024-08-30 20:25:52 +08:00
Tom Cafferkey 44b5f54d08
Add doc blocks to Products shortcode hooks (#51061)
* Add doc blocks to products shortcode woocommerce_before_shop_loop hooks

* Improved comments

* Add changelog
2024-08-30 11:24:34 +00:00
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
Jorge A. Torres d07cb35247
Cherry pick PR#50805 into trunk (#50814) 2024-08-20 20:46:07 -03:00
Jorge A. Torres d2104e1079
Cherry pick PR#50804 into trunk (#50812) 2024-08-20 20:45:13 -03:00
Thilina Pituwala 28ce18e13a
SDK to control product feature usage (#50218)
* Methods for fetching and caching product feature restrictions.

* DTO for passing product feature rule set to the plugin.

* Main class for handling product feature restriction logic.

* Remove unconnected WCCOM site related restrictions.

* Start with minimalist rule

If `\WC_Product_Usage::get_rules_for_product( 27147 )` returns null it
means no rule set to apply for product with ID 27147. Otherwise, it
returns `\WC_Product_Usage_Rule_Set`.

* Remove unused constant

* Remove underscore prefix on the method name; it's discouraged by the linter

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Akeda Bagus <akeda.bagus@automattic.com>
2024-08-21 06:07:31 +07:00
Jorge A. Torres 7e6125ee76
Cherry pick PR#50801 into trunk (#50813) 2024-08-20 18:35:54 -03:00
Jonathan Lane 02596ba4b0
Fix flaky product variations test (#50807)
Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-08-20 13:35:21 -07:00
Gabriel Manussakis 7e08187671
[Accessibility] Make the matching variations alert a live region (#50132)
* Add aria label to the Clear variation options link

* Make the matching variations alert a live region

* Bump add-to-cart variable template version

* Add changelog file

* Add docblock comment to woocommerce_reset_variations_link filter

* Revert changes for Clear variations button

* Make unavailable product combination message a live region

* Improve no matching variation message for screen readers

* Align variables declaration

* Bump template version

* Add role alert to the parent of the no matching message

* Add empty alt text for pesudo-element content

---------

Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
2024-08-20 18:57:30 +02:00
DAnn2012 d2e9e982ec
Fix typo (wc-template-functions.php) (#50147)
* Update wc-template-functions.php

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

* Update plugins/woocommerce/includes/wc-template-functions.php

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Naman Malhotra <naman03malhotra@gmail.com>
2024-08-20 23:29:42 +07:00
Fernando Marichal 771fd00e5d
Featured Product: Fix variable product Selection dropdown (#50633)
* Add hook to SearchListItem

* Add changelog

* Invert is-expanded chevron

* Fix expanded setting

* Fix e2e test

* Add hasChildren and isSelected as dependency
2024-08-20 12:42:35 -03:00
Miguel Pérez Pellicer a883856171
Render GTIN in Product structured data (#50087)
* Add GTIN in structured data

* Changelog

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

* Delete plugins/woocommerce/changelog/50087-tweak-add-gtin-ld-json

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

* Lint

* Delete plugins/woocommerce/changelog/50087-tweak-add-gtin-ld-json

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-20 18:57:23 +04:00
Gabriel Manussakis c9aa65a22f
[Accessibility] Fix focus order on checkout block page (#49649)
* Render total blocks before fields on checkout

* Reverse checkout total blocks position on desktop

* Add changelog file

* Add conditional styles to reverse checkout blocks order

---------

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2024-08-20 15:42:38 +02:00
Fernando Marichal ce98e51430
[Filter Products by Price]: Update view when changing the min/max value (#50651)
* Use handlePriceChange method

* Fix E2E test

* Add changelog

* Remove onBlur

* Add select when clicked

* Fix comment

* Add functionality to experimental block

* Fix E2E test
2024-08-20 10:20:09 -03:00
Alba Rincón 4e76cb11be
CYS - Move the `ai/patterns` endpoint to woocommerce admin API (#50372)
* 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

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

* Fix duplicated entries

* Use AI endpoint base class

* Remove unnecessary change

* Add strict types

* Remove unnecessary return type

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-20 15:17:27 +02:00
DAnn2012 8387b0a842
Fix typo (1140.md) (#50160)
* Update 1140.md

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

* Update 1140.md

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2024-08-20 12:37:13 +01:00
piinthecloud 5098bb1169
create block theme folder (#50638)
* create block theme folder

* add changelog

* update titles
2024-08-20 13:19:47 +02:00