* Store API: Add test coverage for Product Reviews endpoint
* Add changelog file
* Use assertSame() instead of assertEquals()
* Linting
* Fix category_id param test
* 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>
* 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>
* 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>
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
- 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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
* Add changefile(s) from automation for the following project(s): woocommerce
* CYS - Move the ai/images endpoint to woocommerce admin API
* Add changefile(s) from automation for the following project(s): woocommerce
* Use constant and normalize site title values
* Add base AI Endpoint class
* Fix lint error
* Use the endpoint base class
* Revert change
* Add changefile(s) from automation for the following project(s): woocommerce
* Use ai endpoint class
* Add strict types
* Fix lint error
* Add strict type
* Fix lint and use ai endpoint base
* Fix lint
---------
Co-authored-by: github-actions <github-actions@github.com>