* 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>
* 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>
* 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>
* 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>
* Fix typo
Fixed one typo
* Create reviews-guidelines.md
Creating the first draft of the Operation Star guidelines for partners to improve reviews and ratings.
* Adding more info and feedback!
adding info from https://wooengineering.wordpress.com/2024/07/30/closing-the-loop-enhancing-product-reviews-through-integrated-feedback/
* Update docs manifest
* Update menu_title for consistency
* Standardize language + remove unsupported characters from review doc
* Atomize review docs into subcategory + subpages
* Fix linting issues
* Update docs manifest with linter fixes
---------
Co-authored-by: Jacklyn Biggin <hi@jacklyn.dev>
* 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>
* 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>