* 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>
* 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
* 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>
* 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
* 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
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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
* 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>
* 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>
* 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
* 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
* 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>
* 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>
* 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>
* 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>
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.