Commit Graph

19968 Commits

Author SHA1 Message Date
Alexandre Lara b4928ed46a
Product Gallery block: Enable keyboard navigation for thumbnails (#44236)
* Add ability to select thumbnails using keyboard

* Add ability to open the Product Gallery pop up using the keyboard

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

* Fix outline border not showing on Thumbnails on some browsers

* Prevent firefox browser from focusing on UL tag of the Large Image block

* Enable usage of 'Space' and 'NumpadEnter' keys to navigate between the thumbnails

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-06 08:55:03 -03:00
github-actions[bot] a0980a1178
Delete changelog files based on PR 44359 (#44396)
Delete changelog files for 44359

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-02-06 19:52:11 +08:00
Mike Jolley 35630bb52b
Update combobox validation message to be more generic (#44229)
* Update combobox validation message

* Changelog
2024-02-06 11:51:09 +00:00
Luigi Teschio 159d47434b
[CYS - Core] Before installing the fonts, ensure that the font library is available (#44358)
* Avoid duplicating the `/onboarding/themes/recommended` request

* Use `fetchActiveThemeHasMods` in the `fetchIntroData` function

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

* WIP

* WIP

* WIP

* WIP

* Move the `activeThemeHasMods` to outside the `intro` key, since it's used also in other places

Refactor, add comments and cleanup

* Remove unnecessary log

* Set the `activeThemeHasMods` on the parent window to true after the design step to avoid having to fetch it again

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

* Remove unused import

* Add comment and ref to the new issue

* CYS - Core: fix flow when Font Library is not installed

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

* improve naming

---------

Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-02-06 11:28:26 +01:00
Sam Seay 5f00e2f87a
[Experimental] Add e2e tests for the rating filter block (#44192) 2024-02-06 23:22:21 +13:00
Christopher Allford a90b044e73
Updated PNPM Lock File (#44382)
* Updated Lock File

* Add changefile(s) from automation for the following project(s): woo-ai

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-06 09:33:58 +00:00
Alexandre Lara 560f0e933d
Product Gallery block: Prevent block error when a user inputs a decimal number for the Number of Thumbnails setting (#44282)
* fix error on decimal input for the Number of Thumbnails setting

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-05 15:17:35 -03:00
github-actions[bot] b764167f11
Delete changelog files based on PR 44283 (#44368)
Delete changelog files for 44283

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-02-06 00:44:36 +08:00
Mike Jolley fa01e1b541
[Experimental] Add option to `show_in_order_confirmation` for additional checkout fields (#44314)
* Improve readability of register_checkout_field

* show_in_order_confirmation

* changelog
2024-02-05 16:19:34 +00:00
Justin Palmer cd7f429bc1
Remove Customer Order Count from Order Attribution checkout data (#44359)
* Remove Customer Order Count from Checkout Tracks data
2024-02-05 16:06:49 +01:00
Alba Rincón a943de24fa
[CYS] Avoid duplicating requests during the CYS flow (#44179)
* Avoid duplicating the `/onboarding/themes/recommended` request

* Use `fetchActiveThemeHasMods` in the `fetchIntroData` function

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

* WIP

* WIP

* WIP

* WIP

* Move the `activeThemeHasMods` to outside the `intro` key, since it's used also in other places

Refactor, add comments and cleanup

* Remove unnecessary log

* Set the `activeThemeHasMods` on the parent window to true after the design step to avoid having to fetch it again

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

* Remove unused import

* Add comment and ref to the new issue

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2024-02-05 12:36:33 +01:00
Mike Jolley d858d22930
[Experimental] Surface custom fields in My Account pages (#43823)
* Get default attributes on front end

* Remove console log

* Show notice about 0 registered fields in editor

* Do not show block in editor if no fields are registered

* Wrapper block

* Update webpack config

* Wrapper block type definition

* Separate fields from the hook block

* Hide when no custom fields exist

* Address and contact fields

* Shared form fields in settings

* Revert render_content to original

* Allow definition of unchecked value which includes a hidden field

* Move woocommerce_edit_account_form above password section, which should be last.

* My Account hooks

* Move account handling to service class

* Show fields in order details

* Remove unused prop

* remove comment

* Hook docblocks

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

* Add note about nonce verification

* wp_kses_post for label

* fix nonce linting

* Add docblock to hook

* Bump template version

* Persist contact fields to customer

* Change action name

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

* Changelog

* Margin fix on order confirmation for older core themes

* Bump version tags

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-02-05 10:59:17 +00:00
Thomas Roberts 877a16096c
Update notice templates display logic to show updated templates in block themes only (#44283)
* WIP

* Add e2e tests for regular and custom templates

* Allow theme *.zip files for testing purposes

* Bump template versions

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

* Update comments in bash script

* Remove child themes - they will be installed from the zip

* Fix lint error re spacing

* Bump template versions

* Update PHP unit tests for classic style notices

* Revert "Remove child themes - they will be installed from the zip"

This reverts commit 98b1036616.

* Remove classic cart check in test

* Revert "Add e2e tests for regular and custom templates"

This reverts commit ef531854f9.

* Revert test-related changes

* Remove report

* Prevent phpcs warning for not escaped output

It is escaped in the wc_get_notice_data_attr function

* Revert notice changes to core E2E tests

* Update shopper add to cart e2e test to use correct notice class

* Update checkout block E2E test to use correct notice class

* Fix typo

* Update test to check for correct notice classes

* Update notice comment

* Re-apply block template overrides

* Consistent notice check with other templates

---------

Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: github-actions <github-actions@github.com>
2024-02-05 11:50:15 +01:00
Albert Juhé Lluveras 097bd5c8f5
Add e2e tests for password-protected Single Product block template (#44304)
* Add e2e tests for password-protected Single Product block template

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

* Fix tests

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-05 10:47:18 +01:00
Sam Seay 497d4b8a25
Remove class scoping and just use text to find elements (#44289) 2024-02-05 14:27:54 +13:00
Hsing-yu Flowers 24ea7a1848
Move the guest should verify email logic to the order class (#43834)
* Move the guest should verify email logic to the order class

* Refactor for readability and remove redundant code

* Use billing email variable

* Remove white space

* Rename and move email_is_valid to users utils

* Use global WC_DateTime and WC_Session classes

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-02 18:03:07 -08:00
Damián Suárez f1236696d9
[Product Block Editor]: use Textarea block in the variation description field (#44151)
* use text-area for variation desctiption field

* changelog

* tweak // Translators string

* use var to define textarea border color

* remove optional from description label
2024-02-02 15:50:36 -04:00
Jonathan Lane f93dcc292c
Misc e2e test fixes (#44325)
* Change local workers to 1

* Add helpers for adding shipping

* Add shipping zone before order

* Fix tax assertion

* Fix assertion

* Tightened up locators

* Dismiss tour if visible

* Back to function

* Update tax label

* Enable shipping

* Update locator

* Changelog

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-02-02 10:17:32 -08:00
Thomas Roberts 8ac959f4e7
[Experimental] Prevent string-based sanitization on non-string field types in additional checkout fields (#43999)
Co-authored-by: github-actions <github-actions@github.com>
2024-02-02 10:16:02 -08:00
Luigi Teschio 5937b3dec1
CYS - Core: Font Library: disable the installation of the fonts (#44311)
* avoid crash when Gutenberg is not installed

* add issue link

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-02 16:34:33 +01:00
Álvaro Thomas 5fd4176ad0
[e2e tests] Check email for completed order (#44186)
* Add completed order email test

Add test structure to verify completed order email arrival and content

* Verify Email JSON Content

Parse email content in JSON format

* Record email content in JSON

Record email content in JSON

* Update emails completed order checks

Added checks to verify the content of completed order's emails

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

* Update email content const & remove duplicated test

Updated with a new const to record email content const and removed duplicated assertion.

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-02 16:13:16 +01:00
Maikel Perez eaa791f7da
Hide Downloads section under Toggle for product variations (#44152)
* Create DownloadableProductTrait for common downloadable blocks creation

* Use DownloadableProductTrait in SimpleProductTemplate

* Use DownloadableProductTrait in ProductVariationTemplate

* Remeber downloadable files in product variations

* Add changelog file

* Fix php linter error

* Unlink downloads and downloadable product props so they can be managed separately

* Remove invalid margin bottom from the uploader label

* Add changelog file
2024-02-02 10:04:42 -03:00
github-actions[bot] f383284ba6
Delete changelog files based on PR 44207 (#44302)
Delete changelog files for 44207

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-02-02 12:31:53 +01:00
github-actions[bot] 11daa0d5ee
Delete changelog files based on PR 44178 (#44300)
Delete changelog files for 44178

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-02-02 11:45:54 +01:00
github-actions[bot] d7a294cb32
Delete changelog files based on PR 44174 (#44293)
Delete changelog files for 44174

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-02-02 09:58:46 +01:00
Jorge A. Torres ececdf0c1b
Add background HPOS cleanup process (#43293)
* Make legacy data cleanup more performant

* Add legacy data cleanup processor

* Make legacy cleanup available in the UI

* Add some validation around data synchronizer / data cleanup settings

* Add some error handling

* Add changelog

* Make CI happy

* Improve option handling

* Add unit tests

* Partially revert “real time” cleanup

* Re-schedule cleanup on ‘shutdown’ if necessary

* Revert CSS changes for HPOS settings screen

* Revert JS changes for HPOS settings screen

* Allow tools to display a status text

* Move order cleanup to Tools

* PHPCS fixes

* Extend bail early protection to other batch processing functions

* Log and stop cleanup when a full batch fails

* Make PHPCS happy
2024-02-02 12:09:08 +05:30
Manish Menaria 1d8007b822
Product Collection: Return to top after page change (#43817)
* Initial working version

* Update scrolling behavior in product collection block frontend

This commit updates the scrolling behavior in the product collection block's frontend script.

Previously, the code focused on the first anchor or button within a product collection block. This approach was taken to maintain accessibility and ensure that the focused element was scrolled into view. However, this behavior has been changed to improve the user experience.

The updated code now directly scrolls to the first product in the collection. This is achieved by selecting the product using a new selector that targets the `.wc-block-product` class within the `.wc-block-product-template` of the specified `data-wc-navigation-id`. Once the product is selected, the `scrollIntoView` method is used with smooth behavior and start block alignment, offering a more visually appealing scroll effect.

This change enhances the user experience by smoothly directing attention to the beginning of the product collection, making it easier for users to browse products.

* Remove code related to animation

* Fix the issue related to pagination block rendering

- I have improved the code by breaking it into smaller functions
- Added unique `data-wc-key` to each anchor tag

* Enhance Product Collection Block with Interactive Prefetching

* Refine Prefetch Logic & other improvements

This commit further refines the prefetch logic and interactivity in the Product Collection block. It focuses on enhancing code clarity and improving the prefetch behavior based on user interactions.

Key changes include:
1. Renamed 'isPrefetchNextAndPreviousLink' to 'isPrefetchNextOrPreviousLink' in ProductCollectionStoreContext for better readability and accuracy.
2. Modified the scrollToFirstProductIfNotVisible function to accept a wcNavigationId as a parameter instead of a reference
3. Introduced checks for the existence of wcNavigationId in scrollToFirstProductIfNotVisible to prevent unnecessary executions.
4. Updated comments throughout frontend.tsx for enhanced clarity, explaining the prefetch logic and its triggers in detail.
5. Adjusted the logic in the navigate and prefetch functions to align with the new context structure and prefetch strategy.
6. In ProductCollection.php, updated data attributes to align with the revised prefetch strategy.
7. Refined the attribute setting in process_pagination_links function to correctly implement the updated interactivity and prefetch logic.

These changes aim to optimize the prefetch functionality, reduce unnecessary prefetching on initial page load, and ensure a smoother and more efficient navigation experience within the Product Collection block.

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

* Improve comments

* Use wp_json_encode for data-wc-interactive attribute

This commit updates the `ProductCollection` class to use `wp_json_encode` for setting the `data-wc-interactive` attribute value. Previously, the attribute value was hardcoded as a JSON string. Now, by utilizing `wp_json_encode`, we ensure the JSON encoding is handled correctly by WordPress standards, enhancing readability and maintainability of the code.

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-02 12:07:29 +05:30
Sam Seay 6da45f6bed
[Experimental] Add e2e tests for the new active filter block (#44190) 2024-02-02 15:08:01 +13:00
Barry Hughes ded33b7049
Update JS Cookie library to v3.0.5. (#43686) 2024-02-01 11:36:12 -08:00
Luigi Teschio ae1503f588
CYS - AI flow: fix regression - no fonts visible (#44280)
* CYS - AI flow: fix regression - no fonts visible

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

* Trigger Build

* fix lint error

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-01 18:44:28 +00:00
Luigi Teschio e0972ef6ea
[WIP] CYS - Core: add integration with the font library (#44004)
* CYS - Core: add integration with the font library

* install font only when necessary

* refactor logic

* add try catch

* renaming font

* refactor some code

* refactor some logic

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

* remove not used import

* avoid mutability

* improve performance

* update name variable

* fix naming

* fix endpoints after font collection rest controller improvements

* use promise.all into the map

* improve performance

* fix lint error

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-01 17:16:12 +00:00
Karol Manijak 84f2de633d
Fix incorrect product data displayed in Product Collection in context of Single Product block (#44123)
* Initial approach to fix incorrect product data displayed in Product Collection in context of Single Product block

* Remove the BlockCOntextProvider

* Add Block context for title and summary

* Add changelog

* Improve typing

* Add E2E test with Product Collection inside Single Product block

* Improve insertBLock function description

* Make productPrices selector in Product Collectionmore specific

* Extract components props into a types
2024-02-01 17:55:38 +01:00
Maikel Perez 861cc7cc02
Add common options to the variations options empty state (#44001)
* Always show Variation options and Variations sections within the Variations tab

* Remove woocommerce/product-variations-fields block since it's not needed anymore

* Create ProductTShirt image for variation options empty state

* Add renderCustomEmptyState to the attribute control component to be able to set a not default empty state

* Render a custom empty state for variation options

* Adds defaultSearch prop to NewAttributeModal so it can be used to start searching right after the modal is shown

* Let the empty state adds an attribute that matches a given text

* Add changelog files

* Fix linter errors
2024-02-01 11:18:23 -03:00
Luigi Teschio 42a2d00cba
CYS - Core - Check the Font Library availability (#44206)
* Ensure that the Font Library is available

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

* fix iframe issue

* improve comment

* don't return any object

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-01 11:30:50 +00:00
Thomas Roberts 1130380f73
[Experimental] Allow Additional Information block to be moved but not removed (#44193)
Co-authored-by: github-actions <github-actions@github.com>
2024-02-01 02:58:05 -08:00
Thomas Roberts 77d2dd9453
Make combobox suggestions have same border as main input (#44183)
Co-authored-by: github-actions <github-actions@github.com>
2024-02-01 02:57:57 -08:00
Albert Juhé Lluveras d936e4afee
Merge Checkout Header and Mini-Cart template parts tests into parameterized test files (#44176)
* Rename block template customization test files

* Move Checkout Header template part tests to parameterized tests

* Make it so 'userText' in tests is different in each template, so prevent false positives

* Move Mini-Cart template part tests to parameterized tests

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

* Make sure there are products in cart before going to the Checkout template

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-01 11:43:33 +01:00
Vedanshu Jain 4c0f7605b3
Fix refund props not updating properly with HPOS (#44214) 2024-02-01 11:38:17 +01:00
Alfredo Sumaran 9bb7cd7b8b
Apply Rector suggestions for PHP 8.1 (#41482)
* Apply Rector suggestions

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

* Restore false positive

$missing_tables will always be an array

* Restore false positive.

Rector issue: AddDefaultValueForUndefinedVariableRector.

This time the early return is valid so there’s no need to move the $process_limit assignment to the top.

* Ask if $orders is an array

$orders is used as an array lines below. Add `is_array` just in case the “paginate” param is used which would change $orders to an object.

* Check if variable is array

Simplifies variable check given that they are used as an array lines below.

* Restore code as taxes is always an array

* Restore false positive

In the previous loop the $data variable is being built as an array of arrays. Then $value in this loop will allways be array.

* Restore false positive

get_children’s method. of a WC_Product instance will always return an array.

* Simplify variable check

Ask if varialbe is array since it only can be array or false.

* Restore false positive

WC_Blocks_Utils::get_blocks_from_page() will always return an array.

* Restore false positive

There’s a check asking if $existing_meta_data[ $meta_data->key ] is array.

* Restore false positive

$child_ids will always be an array.

* Restore false positives

WC_Product->get_visible_children() will always return an array.

* Restore false positives

WC_Product->get_children() will always return an array.

* Restore false positive

WC_Product->get_visible_children() will always return an array.

* Restore false positive

WC_Order->get_items() will always return an array.

* Restore false positive

The get_matching_rates private method will always return an array.

Updated the @return declaration to be an array instead of boolean.

* Remove unnecessary array type casting.

* Restore false positive

$this->get_children() will always return an array.

* Fix lint issues

* Remove unnecessary default assignment

* Remove unnecessary is_array check

* Remove unnecessary is_array check

* Remove unnecessary is_array check

* Change default value from null to false

* Remove unnecessary is_array check

* Update changelog entry

* Update changelog entry

* Update changelog entry

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

* Update changelog entry

* Use self for consistency

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-01 10:06:12 +00:00
Christopher Allford 7f556d07b2
Removed Unnecessary `@woocommerce/plugin-woocommerce` Asset Copy Caching (#44234) 2024-01-31 16:12:00 -08:00
Jonathan Lane 9c00c2676b
Improve flaky e2e tests (#44208)
* Fix flaky guest checkout tests

* Removed a couple of extra assertions (not needed)

* Enable payment gateway

* Add changelog

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-01-31 10:08:11 -08:00
Veljko V 7c4dca8348
Rename and move test Cart & Checkout Tax Calculation out of isolation and update some locators to use getBy (#44115)
* Move test out of isolation and update it

* Add changelog file
2024-01-31 08:31:33 -08:00
Adrian Moldovan 62101246ca
[e2e tests] Add downloadable product test (#44112) 2024-01-31 17:51:14 +02:00
Karol Manijak a164c8afa9
Fix CI Lint errors (#44228)
* Fix linter issues

* Add changelog
2024-01-31 16:12:30 +01:00
Cem Ünalan f2b77b1ada
Marketplace: Fix the bug hiding connection warning (#44207)
* Marketplace: Fix the bug hiding connection hiding

Actually, this bug causes all modal state to be lost. But since we
check the connection only when the page loads, on a subsequent tries, we can 't show the connection warning.

* Marketplace: update documentation and typos

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-31 12:50:47 +03:00
Paulo Arromba 1e815751ab
Fix/31582 special characters in password on checkout page lead to not working account (#43777)
* Fix registration during checkout

* Added changelog.

* Moved changelog.

* Added correct spacing

* Move password slashing into WC_Checkout:get_posted_data()

* Lint fix
2024-01-31 09:36:58 +00:00
Niels Lange c704ae2cab
Migrate coupon- and shipping-related tests to Playwright (#44108)
* Migrate coupon- and shipping-related tests

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

* Fix prettier issue

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-31 01:23:09 -08:00
Jonathan Lane c96f68e88d
Adds tests to monitor number of JS files included in pages (#44046)
* Adds tests to monitor number of JS files included in pages

* Changelog

* Update file counts

* Changed assertion to LTE

* Revise file counts

* Update numbers

* Increased numbers

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-01-30 14:23:33 -08:00
Thomas Roberts d0b0c4c90b
Set `$plain_text` to false in new email addresses hook (#44178)
Co-authored-by: github-actions <github-actions@github.com>
2024-01-30 10:00:19 -08:00
Mike Jolley 610022150e
Change specificity of date picker rules (#44174)
* Change specificity of date picker rules

* changelog
2024-01-30 17:06:05 +00:00
Luigi Teschio 336abf7a73
Store API - Documentation: Fix broken link (#44180)
* Store API: fix link documentation

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

* fix lint error

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-30 14:23:28 +01:00
Sam Seay 08d5cc05aa
[Experimental] Fix a bug where new attribute filter block flickers in editor. (#44147) 2024-01-31 01:10:12 +13:00
github-actions[bot] 9eff44945a
Prep trunk for 8.7 cycle (#44056)
Prep trunk for 8.7 cycle with version bump to 8.7.0-dev

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-01-30 12:40:10 +01:00
Alba Rincón 1045948487
Update the CYS intro modal copy on Core (#44081)
* Update the CYS intro modal copy on Core

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-30 09:58:51 +01:00
Alba Rincón 595cdeadb0
Create a dedicated survey and tracking events for the CYS flow on core (#43862)
* Create a dedicated survey and tracking events for the CYS flow on core

* Update booleans to show button and survey

* Remove console log

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

* Style required question asterisk and make the questions required

* Fix lint error

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-30 09:58:05 +01:00
Alba Rincón 4ad6b41026
Fix ai status missing on CYS transitional page (#44121)
* Fetch the ai status on the transitional page of the CYS flow

* Only check AI status on WooExpress

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-30 09:54:16 +01:00
Albert Juhé Lluveras 3df7da4bd2
Add theme-customization e2e tests to Cart, Checkout and Order Confirmation templates (#43794)
* Add theme-customization e2e tests to Cart and Checkout templates

* Add theme-customization e2e tests to Order Confirmation template

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

* Update after rebase

* Make it so Order Confirmation template tests are also part of the parameterized tests

* Use CUSTOMIZABLE_WC_TEMPLATES constant instead of defining the templates again

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

* Fix wrong template slug

* Rename 'default' to 'fallback' template

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-30 09:44:42 +01:00
Ilyas Foo 6dd96b3e14
Fix beta test plugin deprecated creation dynamic property (#44109)
* Add plugin_name declaration

* Changelog
2024-01-30 16:12:02 +08:00
Chi-Hsuan Huang 6832a4b249
Update onboarding task documentation & add back `example` command (#44026) 2024-01-30 12:05:46 +08:00
Damián Suárez 74d0b39bb0
[Product Block Editor]: introduce TextArea field block (#44104)
* introduce TextAreaBlockEdit block

* reglister text area block

* use text-area block in the summary block

* changelog

* changelog

* fix whitespace lint issue

* remove unused types

* intrduce placehholder attribute

* property is the only required attribute

* tidy block attributes

* use useProductEntityProp()

* define fallback value

* remove unused CSS class

* organize attrs

* do not implement tooltip yet

* fix eslint error

* update text-area keywords
2024-01-29 17:14:17 -03:00
github-actions[bot] 487c7a87f0
Release: Remove 8.6 change files (#44057)
Delete changelog files from 8.6 release

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-01-29 18:04:49 +01:00
Albert Juhé Lluveras cca2271671
Remove Cart and Checkout templates migration code (#44148)
* Remove Cart and Checkouts templates migration code

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-29 16:12:33 +01:00
Leif Singer be10f00f05
HPOS: fix handling order meta containing nonexistent class when sync is on (#43517)
* add draft test

* test unserializing an order meta with an object of a non-existent class

* appease the linter

* add asserts for the $meta's object_vars

* linter fix

* we actually don't need these to force a sync

* add one to time to avoid potential flakiness

* use simpler fetch for order

* catch the errors and do things manually via wpdb instead

* appease the linter

* add changelog file

* specify format for the insert

* add test for deleting meta

* detect incomplete class in meta value instead of catching and examining errors

* appease the linter

* fix typo

* address review comments

* empty cache when we have manually deleted the post meta

* use `is_object`

* add logging

* log the order ID
2024-01-29 19:04:07 +05:30
Álvaro Thomas 06754dc917
[e2e tests] README.md - Add link to WooCommerce Monorepo prerequisites (#43552)
* Update README.md

Add a link to the WooCommerce Monorepo prerequisites before going through the e2e-pw prerequisites.

* Update WC prerequisites to relative link and added changelog

Update link to WC monorepo prerequisites

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

* Remove duplicated lines

Remove duplicated instructions and leave the step to install Docker and Docker compose

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
2024-01-29 12:31:38 +01:00
Alfredo Sumaran 6cada6447a
Apply Rector suggestions for PHP 8.1 (#43227)
* Apply Rector suggestions

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

* Update changelog entry

* Typo

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-29 17:00:44 +05:30
Mike Jolley 919e2e0060
Prevent `wc_get_chosen_shipping_method_ids` from causing fatal errors if chosen methods are not strings (#43869)
* Check for string values when updating chosen_shipping_methods session

* Ensure filtering woocommerce_shipping_chosen_method provides a string value

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-29 11:22:27 +00:00
Mike Jolley efe07e0ee2
Fix default shipping method selection after rate changes (#44117)
* Change default unless local pickup is being used

* Changelog
2024-01-29 10:07:50 +00:00
Albert Juhé Lluveras 7f735714a4
Add e2e tests for the Page Content Wrapper block (#44122)
* Add Page Content Wrapper e2e tests

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-29 10:11:43 +01:00
Sam Seay cfd8f36578
[Experimental] Utilize WP generated class names to style rating filter block. (#44072) 2024-01-29 19:50:47 +13:00
jonathansadowski 6f9e8531cf
Add wireit build config for woo-ai plugin (#43769)
* Add wireit build config for wooai plugin

* Add changefile(s) from automation for the following project(s): woo-ai

* Add lint config for woo-ai plugin js and css

* Remove build:admin script for wooai

* Remove ci config for woo-ai

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-26 16:08:04 -06:00
github-actions[bot] d7eaca8415
Delete changelog files based on PR 44094 (#44127)
Delete changelog files for 44094

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-01-26 17:32:00 +00:00
Ivan Stojadinov 324b816aec
[e2e] Check email for cancelled order (#43985)
* Add new "can receive cancelled order email" test

* Add new "can receive cancelled order email" test

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

* temp: wait for 1s

* temp: wait for 1s

* Revert changes introduced in 5aa5013

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-26 17:09:02 +01:00
Ivan Stojadinov 5e87527a44
Add "can view product review" test (#44077)
* Add "can view product review" test

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

* Add timestamp to reviewer's email

* Verify reviewer's email and rating

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-26 17:06:36 +01:00
Alfredo Sumaran a656fe0496
Apply Rector suggestions for PHP 8.1 (#43230) 2024-01-26 16:25:11 +01:00
Corey McKrill 022fef4cfb
Logging: Add details about configuration to SSR (#44106)
Adds logs settings values to both the SSR REST API endpoint and to the
HTML version of the SSR screen. Also adds a new method for calculating
the total size of the log directory, and adds that info to the Logs
Settings screen in addition to the SSR.
2024-01-26 16:24:19 +01:00
Mike Jolley a66075ee11
Refactor `get_allowed_countries` and `get_shipping_countries` to make less error prone (#44034)
* Make `get_allowed_countries` default to `all`

* Make `get_shipping_countries` handle `disabled` and apply filter on all cases

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

* changelog

* Put option in variable to avoid multiple calls

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-26 15:11:36 +00:00
Álvaro Thomas 7bfef28ac5
[e2e] Update create simple product test (#43783)
* Update create simple product

Add steps that add description, sale price, SKU, purchase note and an attribute (Color)

* Update  add-virtual-product formatting and locators

Update  add-virtual-product tests with suggested formatting and locators

* Add changelog file

Adding the missing changelog file via pnpm --filter=plugin-woocommerce run changelog add

* Update locators with getBy on product creation

Update product name, price, sale price and virtual checkbox marking locators to use getBy instead

* Update SKU and publish locators with getBy instead

Updated SKU and publish locators with getBy instead

* Added asserts to create-virtual-prd test

Added asserts to create-virtual-prorduct test

* Update SKU check

Update SKU assertion

* Remove keyboard action

Remove press enter keyboard action

* Add changelog

Added changelog file

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

* Update virtualProductName check

Update virtualProductName check to the const instead of the string

* Rebase and format

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Veljko <veljano@yahoo.com>
2024-01-26 10:21:26 +01:00
Adrian Moldovan 4bcb62dc9f
[e2e tests] Add tests for product bulks edit (#44039) 2024-01-26 10:53:05 +02:00
Sam Seay 067cdef753
[Experimental] Utilize WP generated class names to style interactivity stock filter block. (#44073) 2024-01-26 19:29:39 +13:00
Sam Seay 1ce39d98fb
[Experimental] Utilize WP generated class names when styling new active filters block. (#44069) 2024-01-26 19:06:50 +13:00
Thomas Geiger a9997ca1d1
Add filter to block product grid add to cart button to allow extra HTML attributes (#43700) 2024-01-26 09:34:22 +07:00
nigeljamesstevenson 0064abbd0f
Update stable tag to 8.5.2 (#44096)
woorelease: Update stable tag to 8.5.2
2024-01-25 19:44:13 +00:00
Corey McKrill 421ec8e31a
Settings: Ensure row attributes don't have HTML entities (#44094)
In #43166 I changed the way that row classes are added on settings
fields. However, by using `esc_html`, it's actually outputting invalid
HTML, where the double quote wrappers are getting converted to HTML
entities. This simply switches back to escaping only the attribute value
and not worrying if the tr element contains an empty class attribute.
2024-01-25 18:54:39 +00:00
github-actions[bot] 603a4fc689
Delete changelog files based on PR 44037 (#44083)
Delete changelog files for 44037

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-01-25 16:11:00 +00:00
github-actions[bot] 1a38522518
Delete changelog files based on PR 43354 (#44089)
Delete changelog files for 43354

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-01-25 16:10:35 +00:00
Albert Juhé Lluveras 66c3467b69
Avoid duplicate templates appearing on the Site Editor when the WooCommerce template and the theme template have been customized by the user (#44000)
* Avoid duplicate templates appearing on the Site Editor when the WooCommerce template and the theme template have been customized by the user

* Add tests

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

* Clean up templates after running all tests to increase speed

* Fix comment linting

* Fix addToCart() util with the classic template

* Remove unnecessary condition

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-25 14:55:17 +01:00
Mike Jolley dc6af08596
Initialise customer sessions on the order pay page (#43858)
* Create session on the order pay page

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

* changelog

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-25 13:12:10 +00:00
Alba Rincón f46ffe1450
[CYS] Proceed with product creation when their images fail to upload (#44031)
* Return error when the product creation fails

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

* Continue with product creation even when the image upload fails

* Revert

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

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

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

* Add a warning message with the error when creating the products with no images

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-25 12:49:45 +01:00
Luigi Teschio 0a1c4a6920
[CYS - Core] Handling errors during the setup for the `NoAI` flow (#43810)
* CYS - Core: handling errors during the setup

* fix CSS format

* remove export

* fix CSS

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

* fix import

* fix style notice

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-25 12:04:44 +01:00
Mike Jolley 538e45ccb4
Fix SVG markup in miniCartIcon (#44042)
* Update MiniCart.php

* Add changelog entry

---------

Co-authored-by: niharikamahajan02 <72392580+niharikamahajan02@users.noreply.github.com>
2024-01-25 11:03:51 +00:00
Ilyas Foo 2c283d7134
Add rudimentary try catch for all remote endpoint spec evaluators (#44037)
* Add rudimentary try catch for all remote endpoint spec evaluators

* Changelog

* Lint

* More lint
2024-01-25 18:58:15 +08:00
Tung Du 1abefd5eee
[Experimental] Filter block: replace custom upgrade panel by Transforms API (#44024) 2024-01-25 15:28:09 +07:00
Tung Du b50431d9af
[Experimental] Filter block: refactor visibility control, context passing, and filter data processing (#43996) 2024-01-25 13:55:45 +07:00
Vedanshu Jain efd5ccebeb
Add filters for customer email and order id for performance. (#43865)
* Add filters for customer email and order id for performance.

* Empty where should not cause invalid query.

* Add changelog.

* Add unit test for newly supported search params.

* Apply coding standards.

* Add a trailing wildcard to allow broader search.

* Remove extra line.

Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
2024-01-24 16:08:07 -08:00
Cem Ünalan 48ebe7b84c
Marketplace: Add "Add to Store" button for free and WordPress.org products #43616 (#43983)
* Marketplace: Add "Add to Store" button for free and WordPress.org products (#43616)

* Marketplace: Install free .org plugins with Add to Store button

* Marketplace: addressed feedback for the the new install free products flow

- Moved notices to the top of the modal
- Updated notice styles slightly
- Updated the CreateOrderSuccessResponse to reflect API changes

* Marketplace: Require the Helper orders API file

* Marketplace: fix linter errors

* Marketplace: form encode when submitting the request

The body is encoded anyways by the WordPress core. However, if I don't
do it here, I can't create a valid signature to be verified by
Woo.com.

I could have just submitted a JSON too, but this seamed easier since
the body is parsed on Woo.com automatically when it's in this form.

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

* Marketplace: remove "~" character in imports and use relative paths

* Marketplace: fix margins in the product with the Add to Store button

* Marketplace: Add conditions to hide the button

We hide it if:

- the product is already installed
- user doesn't have the right capability
- if the product is just installed using our flow and there is
no page refresh

* Marketplace: don't show Add to Store button on Themes and on Discover

* Marketplace: fix linting

* Marketplace: hide ratings from the product if "is-small" class exists

* Marketplace: fix linting errors

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-24 23:02:20 +03:00
Jonathan Lane 27f079e9b1
Adds tests for core profiler (#44022)
* Adds tests for core profiler

* Add additional assertions

* Add changelog

* Standardize spacing

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-01-24 12:00:52 -08:00
Tomek Wytrębowicz 1976e40136
Remove wp-data & wc-blocks-checkout dependencies from OA script (#43857)
Resolve conditional dependency in JS.

Fixes #43829

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2024-01-24 18:58:57 +01:00
Tarun Vijwani 0c79d1b6a7
Display shipping calculator link in the Cart block when fallback shipping options available (#43803)
* Hide the shipping rates in editor to match front-end

- If there are no shipping rates, hide the shipping rates in editor to match front-end.

* Add get_shipping_zones method to CartCheckoutUtils

* Display change address like for fallback shipping zone

- If cart has multiple and default shipping zones without shopper address, display the change address link

* Update shipping address label

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

* Fix linting errors

* Update plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/totals/shipping/shipping-address.tsx

Co-authored-by: Niels Lange <info@nielslange.de>

* Display shipping calculator for locations outside all other zones

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

* Update typescript for activeShippingZones

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2024-01-24 20:40:53 +04:00
louwie17 11aa8b6c46
Update product editor experiment name for new release (#44014)
* Update experiment name and enable linked products

* Add changelog
2024-01-24 11:41:05 -04:00
Thomas Roberts 0ecb53f61c
[Experimental] Update args for `woocommerce_blocks_validate_additional_field_{key}` filter (#44012) 2024-01-24 07:06:16 -08:00
Albert Juhé Lluveras 081f9d303b
Move Cart, Checkout and Order Confirmation template customization tests to the parameterized tests file (#43992)
* Move Cart, Checkout and Order Confirmation template customization tests to the parameterized tests file

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

* Clean up order-confirmation.block_theme.spec.ts file

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-24 15:26:07 +01:00
Adrian Moldovan 0aebb139c2
Update eslint parser to @babel/eslint-parser (#43859) 2024-01-24 13:06:51 +02:00
Vlad Bozdog a6210ba312
43813 hpos add missing filters on order listtable (#43815)
* add filter on build_count_query

* 43813-hpos-add-missing-filters-on-order-listtable

* 43813-hpos-add-missing-filters-on-order-listtable

* 43813-hpos-add-missing-filters-on-order-listtable

* 43813-hpos-add-missing-filters-on-order-listtable

* 43813-hpos-add-missing-filters-on-order-listtable

* 43813-hpos-add-missing-filters-on-order-listtable

* 43813-hpos-add-missing-filters-on-order-listtable

* Update plugins/woocommerce/src/Internal/Admin/Orders/ListTable.php

Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>

* Update plugins/woocommerce/src/Internal/Admin/Orders/ListTable.php

Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>

* 43813-hpos-add-missing-filters-on-order-listtable

* 43813-hpos-add-missing-filters-on-order-listtable

---------

Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
2024-01-24 09:17:25 +01:00
Chi-Hsuan Huang aa028da0b7
Send store address data to the obw subscribe endpoint (#43848)
* Sync country name to Klaviyo and Mailchimp

* Add state name

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-24 09:43:46 +08:00
Ilyas Foo f85d275c3a
Fixes `strpos` in `ComparisonOperation` for PHP 8 (#44007)
* Fixes

* Changelog

* Add breaks
2024-01-24 08:42:41 +08:00
jonathansadowski 9b98a85380
Remove docs plugin from monorepo (#44013)
* Remove docs plugin from monorepo

* Add language to md-docs readme

* Fix lint error in blocks

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-23 16:16:07 -06:00
Adrian Moldovan d66a48e8e5
[e2e tests] Add tests for product images (#43775)
* Import media on environment setup

* Add product-images.spec with one complete test and all other skeleton tests

* Add changelog

* Implement can update the product image

* Implement can delete the product image

* Implement can delete the product image

* Skip not implemented test

* Merge fixtures

* Add productWithImage fixture

* Remove unused variable `api`

* Partial implementation of can create a product gallery

* Check the image gallery in store frontend

* Added `can update a product gallery` test

* Run all tests

* Search for image in media library

* Check that the remove gallery image is not displayed

* Add repeatEach configuration

* eslint formatting

* Extract some repeating steps into a function

* Update check for thumbnail

* Fix test image name
2024-01-23 13:31:22 -08:00
Maikel Perez 9f3c7885a4
Remember downloadable files (#44008)
* The previously uploaded file should re-appear when the product changes from downloadable to not and then back again

* Add changelog file

* Fix php linter error
2024-01-23 14:53:22 -03:00
louwie17 1a4ebebf6a
Fix description toolbar with latest GB version (#43835)
* Initial changes to fix the toolbar in the iframe editor

* Moved toolbar to header and respect fixedToolbar preference

* Only render Gutenberg toolbar with specific version

* Update GB version

* Fix build issue

* Add fixed toolbar menu

* Remove unused import

* Add changelogs

* Fix lint errors

* Fix PHP lint error
2024-01-23 11:17:37 -04:00
Maikel Perez 26a546954a
Hide Downloads section under Toggle (#43864)
* Add Include downloads to show/hide the Downloads section

* Fix margin top for none first child nested sections

* Add changelog files

* Fix php linter errors
2024-01-23 12:12:52 -03:00
Maikel Perez dbae7d6661
Create product-pre-publish-modal feature flag (#43861)
* Create product-pre-publish-modal feature flag

* Add changelog file

* Fix auto formatting change
2024-01-23 11:46:52 -03:00
Maikel Perez 7ec8f7932e
Variations tab should be moved to the second tab, after General (#43998)
* Move variations tab to position 2 so it will appear right next to the general tab

* Add changelog file
2024-01-23 11:45:59 -03:00
Niels Lange 30dfa013f9
Unskip e2e tests (#43852)
* Remove obsolete comment

* Unskip cart and checkout translation tests

* Unskip shipping method switching tests

* Unskip template-related e2e tests

* Unskip order confirmation test for guest users

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

* Adjust broken e2e tests

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-23 21:32:10 +07:00
Alba Rincón a44a45b56a
CYS Redirect to intro screen if theme is not modified (#43736)
* Redirect to intro screen if theme is not modified

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

* Add and fix test for the redirection

* Redirect with the proper url 'intro'

* Remove only

* Avoid completing the cys task when switching themes

* Revert prev commit and reset `woocommerce_admin_customize_store_completed` before each test

* Set the `woocommerce_admin_customize_store_completed` to `no` before each test

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-23 11:15:19 +01:00
Alfredo Sumaran 4fd42aa7c5
Apply Rector suggestions for PHP 8.1 (#43236)
* PHP 8 Updates for src/Internal

* Add changelog entry

* Fix PHP lint issues

* Add unit test for not in queries.

---------

Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
2024-01-23 15:32:46 +05:30
Ilyas Foo 8a1af8a432
Add "I'm selling online and offline" for Square credit card payment recommendation (#43816)
* Add online offline for Square credit card

* Lint

* Changelog

* Update plugins/woocommerce/src/Admin/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php

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

---------

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2024-01-23 13:52:27 +08:00
Sam Seay 42e77d4938
[Experimental] Product Filter - Reintroduce Wrapper Block (#43688) 2024-01-23 18:29:24 +13:00
Chi-Hsuan Huang 9b7d9ce689
Update the onboarding profile API validation for `business_extensions` parameter (#43806)
* Update the validation for business_extensions parameter

* Add changelog
2024-01-23 10:53:16 +08:00
Justin Palmer 8baa07e029
Remove `UTM` from Order Attribution metabox labels (#43041)
* Rename order attribution template file
* Update OA field name to `source_type` to keep up with https://github.com/woocommerce/woocommerce/pull/41690
* Discard conditional UTM labels altogether

---------

Co-authored-by: Tomek Wytrębowicz <tomalecpub@gmail.com>
2024-01-23 01:40:05 +01:00
Damián Suárez 0940201c37
Add suggested-products product endpoint (#43720)
* init approach of related products endpoint

* register related prodducts endpoint

* rename response prop with ids

* filter categoris from endpoint params

* filter categories when pulling related products

* changelog

* extend from WC_REST_CRUD_Controller class

* iterate over defininf endpoint params

* doc

* merge product terms with params

* introduce `combine` param

* return products collection instead of plain array

* fixinf eslint issues

* pass proper fn args to bound fns

* do not call parent register method

* post type is defined by parent controller class

* remove related products controller

* extend products controller with `related-products`endpoint

* filter post__in param

* when no related products found return empty array

* change and register endpoint params

* remove commented line

* add a custom method to extend the params

* update

* fix typo

* ensure to respect the products limit

* fix eslint issue

* remove unrequired endpoint id param
2024-01-22 17:18:02 -03:00
Christopher Allford db8da8d712
Properly Configured Wireit Production Builds (#43716) 2024-01-22 10:13:45 -08:00
Tarun Vijwani 139150134f
Add store notices to the Cart and Checkout block templates (#43753)
* Fix session notices in Cart and Checkout block pages

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

* Update plugins/woocommerce-blocks/assets/js/base/components/notice-banner/style.scss

Co-authored-by: Niels Lange <info@nielslange.de>

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2024-01-22 21:25:42 +04:00
Néstor Soriano 7c62443ebe
Improve the logging/noticing of Legacy REST API usages (#43851)
* Include request IP address in the logging of Legacy REST API usages

* Add link to the Legacy REST API plugin to the usage notices
2024-01-22 17:02:19 +01:00
Alfredo Sumaran e48849444c
Apply Rector suggestions for PHP 8.1 (#43235)
* PHP 8 updates for src/Database/*

* Add changelog entry

* Update changelog entry
2024-01-22 15:30:31 +00:00
Barry Hughes f6fbb42652
Optimize performance of `WC_Install::is_new_install()`. (#43767) 2024-01-22 16:08:05 +01:00
Mike Jolley 18cd0a9690
[Experimental] Surface custom fields in Emails (#43519)
* Get default attributes on front end

* Remove console log

* Show notice about 0 registered fields in editor

* Do not show block in editor if no fields are registered

* Wrapper block

* Update webpack config

* Wrapper block type definition

* Separate fields from the hook block

* Hide when no custom fields exist

* Address and contact fields

* Shared form fields in settings

* Revert render_content to original

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

* Get default attributes on front end

* Add initial sections to email templates

* Revert "Get default attributes on front end"

This reverts commit f76c21617a2c5ad832d4579ba2c4c8e98afd440d.

* Also render contact fields

* Handle plain text

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

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

* Unwanted changes from rebase

* Use get_order_additional_fields_with_values

* Remove sample fields

* Version bump for styles

* Update plugins/woocommerce/includes/class-wc-emails.php

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Update plugins/woocommerce/includes/class-wc-emails.php

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Apply view context

* Handle null

* Context

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2024-01-22 13:56:22 +00:00
Thomas Roberts 4114c5a5f1
[Experimental][Refactor] Reduce complexity of custom field registration function (#43663)
Co-authored-by: github-actions <github-actions@github.com>
2024-01-22 05:48:23 -08:00
Albert Juhé Lluveras c1b131c869
Add e2e tests to verify specific theme templates have priority over user-modified Product Catalog template (#43750)
* Add e2e tests to verify specific theme templates have priority over user-modified Product Catalog template

* Add changefile(s) from automation for the following project(s): woocommerce-blocks
2024-01-22 14:44:07 +01:00
Albert Juhé Lluveras 550bfe3572
Update WC Blocks Playwright tests docs so we pass parameters correctly to PNPM scripts (#43779) 2024-01-22 11:20:59 +01:00
Alba Rincón 95ed989ab4
Fix handling the error from the `product_image_upload` and `update_product_content` functions (#43793)
* Fix handling the error from the `product_image_upload` function

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

* Fix linting errors

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-22 09:59:51 +01:00
Thomas Roberts 7dabf2b031
[Experimental] Add `$request` to additional fields validation filter (#43789)
* Add $request to additional fields filter

* Add changelog entry

* Add data to additional message
2024-01-19 23:21:47 -08:00
Veljko V 7f2fd37fad
Refactor code and merge checkout and coupon tests and add new restricted cart coupons tests (#43819)
* Add changelog and update var naming in block tests

* Format code in two tests

* Add missing payment method set to the test

* Refactor tests and merge cart checkout coupons

* Clear cookies before every test
2024-01-19 10:32:19 -08:00
Mike Jolley 60509aa539
[Experimental] Surface additional checkout fields values in Admin order page. (#43748)
* Get default attributes on front end

* Remove console log

* Show notice about 0 registered fields in editor

* Do not show block in editor if no fields are registered

* Wrapper block

* Update webpack config

* Wrapper block type definition

* Separate fields from the hook block

* Hide when no custom fields exist

* Address and contact fields

* Shared form fields in settings

* Revert render_content to original

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

* Show address placeholders

* View fields in admin

* Pass order object and context to field hooks in WP admin

* CheckoutFieldsAdmin class

* Move logic to CheckoutFieldsAdmin

* Implement context

* Style checkboxes correctly in meta box

* Update handling

* Undo change to changelog

* Correct docblock comment for woocommerce_admin_shipping_fields

* Document context

* No need to init fields

* Fix checkbox handling for bw compat reasons

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

* Force CI

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

* Fix CSS rule

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-01-19 11:35:17 +00:00
Luigi Teschio f866d0d30f
[CYS - Core] Improve loading screen (#43791)
* CYS - Core: Create dummy products

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

* CYS - Core: Improve loading screen

* fix import

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

* update image

* add missing image

* fix CSS

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-19 12:03:19 +01:00
Jonathan Lane a0988461ec
[E2E] Tests for coupon usage restrictions (#43590)
* Changelog

* Tests for restricted coupons

* Update to test checkout not cart… which is what I should have been using

* Removal -- from PR feedback

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-01-19 10:49:24 +01:00
Alfredo Sumaran f2e90aa01d
Apply Rector suggestions for PHP 8.1 (#43237)
* PHP8 Fixes for templates dir

* Add changelog entry

* Bump template version

* Bump template version number

* Update changelog entry

* Typo
2024-01-19 10:07:53 +01:00
Alfredo Sumaran 5b6897e690
Apply Rector suggestions for PHP 8.1 (#43229)
* Apply Rector suggestions

* Add changelog entry

* Update changelog entry

* Fix PHP Lint errors
2024-01-19 10:07:06 +01:00
Niels Lange 32282a00ce
Add tracking for incompatible extensions (#42816)
* Add tracking for incompatible extensions

* Separate tracking data
2024-01-19 13:03:33 +07:00
Chi-Hsuan Huang 5bdc56e287
Fix activity panel showing incorrect currency (#43733)
* Fix activity panel showing incorrect currency

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

* Use store currency setting when order currency is different from the store currency

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-19 12:20:36 +08:00
Atanas Penchev 32ca8c16f2
Replace FlexSlider $.fadeIn() with vanilla .animate() (#41979)
* Vanilla .animate() instead of jQuery .fadeIn()

* Slider .animate() keyframes are now a list with 2 objects

[{ marginLeft: old }, { marginLeft: new }] keyframe syntax instead of
{ marginLeft: [old, new] } keyframe syntax for consistency

* Changelog

* Tweak changelog.

---------

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2024-01-18 15:30:51 -08:00
Ivan Stojadinov 50b4275174
[e2e] Expand simple product creation with more details (#43710)
* Expand 'can create simple non-virtual product' test

* Expand 'can create simple non-virtual product' test

* revert line break

* changelog add

* Revert "changelog add"

This reverts commit 0aa8f62cf7.

* Changelog - add update details

* Use getBy* where appropriate

* Add more geyBy*s

* Add more geyBy*s #2

* Add API calls to delete category and tag

* Update productCategory
2024-01-18 09:59:15 -08:00
Gan Eng Chin 6246cf6ff2
Marketing: Add "Sales" column in Campaigns card (#43284)
* Add sales property to MarketingCampaign class.

* Return campaign sales data in API.

* Display Sales in Campaigns card.

* Fix test for useCampaigns.

* Display a "-" when there are no cost or sales value in Campaigns card.

* Add changelog.

* Fix test for useCampaigns hook.

* Fix PHP lint issue.
2024-01-19 01:42:35 +08:00
Luigi Teschio c6e5d0d504
CYS - Core: Create dummy products (#43784)
* CYS - Core: Create dummy products

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 15:52:49 +01:00
Alba Rincón 589259f39f
[CYS on Core] Intro screen - Update the copy depending on whether the user already started to customize their store (#43690)
* Add new banner for no-Ai existing theme

- Add new banner
- Update copy
- Refactor the theme preview structure

* Make preview optional

* Remove log

* Remove unused param

* Fix linting error

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 14:59:10 +01:00
Niels Lange 7cd04dfa5a
Add e2e test to hover Mini Cart totals (#43693)
* Add e2e test to hover Mini Cart totals

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

* Optimise hover test

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 20:06:28 +07:00
Thomas Roberts bf61e57ce4
Ensure "email" field id does not include the section ID (#43734)
Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 04:33:50 -08:00
Albert Juhé Lluveras 91d0e16151
Convert block templates tests to parametized tests (#43778)
* Convert block templates tests to parametized tests

* Use frontendUtils.addToCart() when possible

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 13:29:07 +01:00
Albert Juhé Lluveras 6c3f8cb6fb
Add e2e tests to verify block templates can be customized if the theme has its own custom templates (#43650)
* Update commands to run e2e tests

* Capitalize Product Catalog template name

* Create tests with block theme with templates

* Create Block Theme with Templates test environment

* Update classic theme commands

* Code cleanup

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

* Code cleanup (II)

* Add config to blocks-playwright.yml and remove unnecesssary .github/workflows/playwright.yml file

* Remove unnecessary imports from product-catalog-template.block_theme_with_templates.spec.ts

* Update blocks e2e commands to pnpm

* Replace hardcoded strings with a variable

* Unify all 'block theme with templates' tests in a parameterized test

* Create a testData object for the Mini-Cart template part test

* Fix some code styling issues

* Create a testData object for the Mini-Cart template part test (II)

* Remove duplicate userText variable

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 11:39:24 +01:00
Manish Menaria 8c284a5074
[Product Collection] Add unique ID attribute (#43314)
* Add unique ID attribute to Product Collection block

In this update, we introduced a unique identifier for each instance of the Product Collection block. This change involves several key modifications:

1. **Block JSON Update**: Added a new `id` attribute in `block.json` to store the unique identifier for each block instance.

2. **Product Collection Content Update**: In `product-collection-content.tsx`, we utilized the `uuid` library to generate a unique ID. This is done in a `useEffect` hook, ensuring that each block instance receives a distinct ID upon initialization.

3. **Type Definitions**: The `ProductCollectionAttributes` interface in `types.ts` was updated to include the new `id` attribute, aligning with our enhanced data structure.

4. **Package Dependencies**: To support this feature, `@types/uuid` and `uuid` were added to `package.json`, ensuring we have the necessary tools for ID generation.

This enhancement is pivotal for uniquely identifying each Product Collection block, paving the way for more robust and individualized block handling in the future.

* Rename uniqueId to id

* Add lock file

* Add 'id' context to product collection and template

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

* Merge trunk with 42861-introduce-a-unique-identifier-for-each-product-collection-block

* Regenerate the lockfile

* Remove autogenerated change in plugins/woocommerce/package.json

* Regenerate lock file

* Rerun CI actions

* Delete pnpm-lock.yaml file & regenerate it using pnpm install command

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 15:30:57 +05:30
Luigi Teschio 0a98e5acd6
[CYS - Core] Switch to TT4 when the flow starts (#43740)
* CYS - Core: add unit test

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

* fix description

* Enable TT4 when the customize your store process starts

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-17 15:09:12 +01:00
Matt Sherman 824dc6be51
Remove BlockTemplateRegistry (#43589) 2024-01-17 07:12:12 -05:00
Vlad Bozdog 4966697b7f
41827-improve-coupon-usage-by-user-query-performance (#43731)
The sql query can be slow on big data sets, because the post meta value is type of string, and we are quering with a number.
2024-01-17 11:29:28 +01:00
Vedanshu Jain 90b3e11dba
HPOS: Remove buggy check in the data cleanup tool. (#43727)
* Add refund order to unit test.

* Remove buggy defensive check since existance of order is already verified.

* Changelog.

* PHPCS fixes.

* Added more assertions after cleanup to verify cleanup worked.
2024-01-17 14:58:11 +05:30
Chi-Hsuan Huang 8b567dcbc7
Update payment partners 2024 q1 (#43514)
* Remove eway and zipco

* Add Airwallex

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

* Fix lint

* Update airwallex images

* Fix category_other value

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-17 09:40:08 +08:00
Alexandre Lara 8258919e22
Product Gallery block: Remove the experimental flag from the Product Gallery block (#43586)
* Remove the experimental flag from the Product Gallery block

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-16 21:05:47 -03:00
Karol Manijak 1dd23f8eeb
Product Collection: add E2E tests to Editor filters - by featured products, by created date, by price range (#43473)
* Add test to Product Collection - featured products filters

* Open Featured option before trying to set it up

* Add test for Created filter

* Add missing awaits

* Add tests for a price range filter

* Add explanation to test step

* Update the conditions for created filter

* Add changelog

* Change leftover values

* Empty commit - trigger CI
2024-01-16 20:59:27 +01:00
Vedanshu Jain 4b401e59de
Add support for specifying filters when searching orders. (#43356)
* Add the UX element dropdown for search box.

* Add unit test for search_filter param.

* Add support for search filter in search query for better performance.

* Link search_filter dropdown with query param.

* Fix conflicts.

* Reformat to allow adding more filters in future.

* Fixing margin in the search filter box.

* Fix merge conflict.

* Apply linting.

* Add changelog.

* Apply PR suggestions.

* Grammer fixes.
2024-01-16 20:37:16 +05:30
Mike Jolley 1dee94362f
[Experimental] Surface additional checkout fields on Order Confirmation page (#43449)
* Get default attributes on front end

* Remove console log

* Show notice about 0 registered fields in editor

* Do not show block in editor if no fields are registered

* Wrapper block

* Styling/spacing

* Update webpack config

* Register heading pattern

* Wrapper block type definition

* get_fields_for_location return fields in array format

* Use wrapper in default content

* Separate fields from the hook block

* Hide when no custom fields exist

* Address and contact fields

* Shared form fields in settings

* remove info block from wrapper

* Revert render_content to original

* rename block

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

* Update styling

* Create shared get_order_additional_fields_with_values to format values

* Update block names and descriptions

* Show address placeholders

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

* Unused import

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-01-16 13:17:28 +00:00
Luigi Teschio dc0fd26917
CYS - Core: add unit test for the `NoAI` flow state machine (#43692)
* CYS - Core: add unit test

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

* fix description

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-16 14:01:31 +01:00
Thomas Roberts c776fb63bc
[Experimental] Add custom validation hooks for additional checkout fields (#43435)
Co-authored-by: github-actions <github-actions@github.com>
2024-01-16 03:01:51 -08:00
Alba Rincón b9f447b101
Update copy for CYS intro screen sidebar (#43551)
* Update copy for CYS intro screen sidebar

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

* Avoid using variables in __()

* Add missing period

Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2024-01-16 09:07:47 +01:00
Karol Manijak c531067daf
Improve the selector determining the products are loaded in Product Collection tests (#43464)
* Improve the selector determining the products are loaded in Product Collection tests

* Add changelog

* Update plugins/woocommerce/changelog/test-42038-make-product-collection-e2e-tests-more-robust

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

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2024-01-16 08:31:22 +01:00
Niels Lange 9779f0a022
Migrate mini cart tests (#43549)
* Migrate mini cart tests

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

* Adjust broken e2e test

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-16 13:58:54 +07:00
Adrian Moldovan 04154eee09
[e2e tests] New test that checks a customer can comment on a post (#43419)
* Add new spec for checking comments on a post

* Add changelog

* Update locators to use geBy methods

* Update locators to use geBy methods

* Fixed strict mode violation
2024-01-15 15:24:22 -08:00
Thomas Roberts 23db3eff69
[Experimental] Handle adding attributes during fields registration (#43379)
Co-authored-by: github-actions <github-actions@github.com>
2024-01-15 14:59:36 -08:00
Jonathan Lane f7e8b676d6
Change HPOS and non HPOS e2e tests to use 5 shards each (#43672)
* Change HPOS and non HPOS e2e tests to use 5 shards each

* Add changelog

* Update numbering

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-01-15 14:18:57 -08:00
Christopher Allford 95bc1189e5
Update `wireit` & Optimize Builds (#43595)
This bumps the version to 0.14.3 so that we can take advantage of some
upstream improvements. It also makes some changes to the way our
builds and watches work to minimize the number of unnecessary
Node processes involved in the execution.
2024-01-15 14:06:55 -08:00
Danny Dudzic 43be71a52f
[Experimental] Product Gallery: Update div elements to ul/li for better accessibility (#43612)
* Product Gallery: Update div elements to ul and li for better accessibility

* Product Gallery: Add changelog files

---------

Co-authored-by: roykho <roykho77@gmail.com>
2024-01-15 13:04:03 -08:00
Christopher Allford 31c170f80c
Added Missing Lint Build (#43665)
Unfortunately, it looks like we need to build in order
to be able to lint. This makes sense since some
projects will lint imports from others that haven't
been built yet.
2024-01-15 12:30:54 -08:00
Alejandro López Ariza cb269e47ab
Update stable tag to 8.5.1 (#43671)
woorelease: Update stable tag to 8.5.1
2024-01-15 20:38:09 +01:00
Adrian Moldovan 357e37819f
[e2e tests] Add new spec for remove product tests (#43518) 2024-01-15 20:23:30 +02:00
Tarun Vijwani d329ced1e8
E2E tests migration: performance -> cart (#42943)
* Add Performance Util class to evaluate performance

* Add performance logging in cart block test

* Remove additional comments

* Migrate Cart  E2E performance tests to Playwright

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

* Refactor performance calculations in PerformanceUtils page

* Fix linting errors

* Replace beforeAll with beforeEach

* Fix directory creation in performance-utils.page.ts

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2024-01-15 21:03:24 +04:00
github-actions[bot] 33ae0d607d
Delete changelog files based on PR 43641 (#43646)
Delete changelog files for 43641

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-01-15 16:06:42 +00:00
Maikel Perez d853af297b
Improve the validation process when changing the product type (#43564)
* Remove the required validation constraint from the LINK TO THE EXTERNAL PRODUCT field

* Add changelog file
2024-01-15 12:49:24 -03:00
Alba Rincón 50c7e51d86
Add "No AI" banner image and center banner content (#43547)
* Add "No AI" banner image and center banner content

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-15 14:17:33 +01:00
Karol Manijak 2c628a2938
Product Collection: add E2E tests to Editor filters - by tag and by stock status (#43548)
* Add test to check Product Collection filtering by tags

* Set single product out of stock and unskip the test for stock status

* Add changelog

* Use more specific selector

* Update variables holding products in products.sh to keep the same convention
2024-01-15 11:25:49 +01:00
Leif Singer 89cb0f7cef
clarify comment in maybe_sync_order (#43573)
* clarify comment in maybe_sync_order

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

* appease the linter

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-15 10:24:29 +01:00
Vedanshu Jain e1f57da0ad
Use GMT date when fetching cancellation orders. (#43641) 2024-01-15 09:09:19 +01:00
Christopher Allford 758df4854d
Use `ci-jobs` Utility For `ci.yml` Matrix (#43532)
This adds support for using the `pnpm utils ci-jobs` command in our `ci.yml` file. One of the bigger benefits to this change too is that we're now distributing a bundled version of the utils tool. This lets us run it without actually having to install the repo and will let us speed up any workflows that currently do.
2024-01-12 20:32:14 -08:00
Maikel Perez 4f8922aa0b
Remove Variable product template from the product template list (#43422)
* Remove variable-product-template from the product template list

* Add changelog files

* Redirect the variable product to the new experience now that is does not have a product template anymore

* Fix php linter error
2024-01-12 18:47:15 -03:00
Alexandre Lara 4b5c6982e4
[Experimental] Product Gallery block: Prevent page from scrolling when pop-up is open (#43378)
* Prevent body from scrolling when pop-up is open

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

* Add namespace to the modal-open css class

* Fix class name for the Product Gallery block

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-12 15:10:33 -03:00
Vlad Olaru 469b74433c
Fix Subscriptions autorenewals column for WooPayments pre-install promo in Settings > Payments (#43436)
* Do not sanitize WooCommerce Subscriptiion column HTML in Settings > Payments methods table

* Add features supports entry to pseudo-gateway WCPay Promotion

* Add changelog

* Add changelog entry for woocommerce-admin

* Lint fixes
2024-01-12 19:05:29 +02:00
Matt Sherman ee6642e0c7
Product Editor: Load layout templates from the REST API (#43384)
* Move ProductTemplate type

* useProductTemplate

* Use useProductTemplate

* Use useLayoutTemplate

* Handle if window.productBlockEditorSettings doesn't exist

* Unit tests for useProductTemplate

* Fix fallback in useProductTemplate

* Remove layoutTemplates from ProductEditorSettings on client

* Fallback to simple-product layout template

* Unit test to verify the standard product template is used if product type is variable

* Use standard product template if product type is variable

* Unit test to verify product type is used to match if product template id matches a template with a different product type

* Make sure product type matches on product template, unless variable, in which case we match simple

* Remove layoutTemplates and layoutTemplateEvents from global

* Changelog

* Changelog

* Import types only
2024-01-12 11:54:35 -05:00
github-actions[bot] ad735b2bf2
Delete changelog files based on PR 43550 (#43568)
Delete changelog files for 43550

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-01-12 17:00:10 +01:00
github-actions[bot] 69360cd93e
Delete changelog files based on PR 43497 (#43563)
Delete changelog files for 43497

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-01-12 16:52:50 +01:00
github-actions[bot] f6f7c076f4
Delete changelog files based on PR 43504 (#43523)
Delete changelog files for 43504

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-01-12 16:52:02 +01:00
github-actions[bot] 6dba702341
Delete changelog files based on PR 43506 (#43539)
Delete changelog files for 43506

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-01-12 16:51:44 +01:00
Jonathan Lane ac5ffdae46
Move e2e HPOS disabled tests to matrix (#43537)
* Move e2e HPOS disabled tests to matrix

* Changelog

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-01-12 10:30:10 -04:00
Alba Rincón be1c794387
Remove the `patterns_ai_data` post from DB when resetting the CYS (#43499)
* Call the `/wc/private/ai/patterns` to remove the `patterns_ai_data` post from the db

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-12 13:58:32 +01:00
Luigi Teschio 5edea79b41
CYS: fix php warning raise by the Product Collection block (#43546)
* CYS: fix php warning raise by the Product Collection block

* fix typo

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-12 13:44:06 +01:00
Albert Juhé Lluveras aa661f2234
Fix Mini-Cart price disappearing on hover (#43550)
* Fix Mini-Cart price disappearing on hover

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-12 13:39:34 +01:00
Roy Ho 5d87130b43
[Experimental] Product gallery/remove default (#43487)
* Remove Product Gallery block as default

* Add beta label to Product Gallery block title

* Add changelog files
2024-01-11 18:03:58 -08:00
Niels Lange 780196a5b0
Fix notice template overwrites (#43506)
* Fix notice template overwrites

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

* Bump template versions

* Changing template version numbers to 8.5.0 as they haven’t been touched

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-11 22:12:55 +01:00
Jorge A. Torres 9ce508f47d
Add HPOS CLI tool to compare an order between datastores (#43173)
* Add `wp wc hpos status` command

* Add helper method to build order from different datastores

* Add helper method `get_diff_for_order()` to compare orders between datastores

* Add CLI tool `wp wc hpos diff` to compare an order between datastores

* Add changelog

* PHPCS fixes

* Better format for dates
2024-01-11 16:51:01 +00:00
Luigi Teschio ac43fb2426
fix ESLint configuration regarding import path aliases (#43421)
* fix ESLint configuration regarding import path aliases

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

* fix eslint configuration

* update eslint-import-resolver-typescript version

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-11 16:40:38 +01:00
Vedanshu Jain c675ce53a5
Fix product prices not being updated on scheduled sale automatically. (#43497)
* Add test for scheduled date start

* Add more test around product sales.

* Simplify sales check + also check product sale price is changed.

* Apply conding standards.

* Add changelog.

* Revert changes added in 39948 with explanation.

* Revert changes added in 39948 with explanation.
2024-01-11 15:18:18 +00:00
Luigi Teschio c409fcd050
[CYS - Core] introduce route guards for the AI flow (#43481)
* CYS - Core: Setup the site with a default homepage when the assembler is loaded

* CYS - Core: Implement route guards

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-11 16:12:41 +01:00
Seghir Nadir 77d0a6a847
Limit cookie dedupe logic to only WooCommerce Cart cookies (#43504)
* limit check to only Woo cookies

* limit logic to woo cookies only

* add changelog

* no need for set-cookie prefix
2024-01-11 15:53:50 +01:00
Luigi Teschio c686f605e6
[CYS - Core] Update the homepage with default patterns when the assembler is loaded (#43457)
CYS - Core: Setup the site with a default homepage when the assembler is loaded
2024-01-11 15:32:16 +01:00
Paulo Arromba 99e825df1f
Migrate merchant local-pickup e2e tests to Playwright (#43057)
* Playwright migrated test file bootstrap and first test for local pickup

* Added page reload to force a new render

* Updated test description

* WIP: figuring out the fake input checkbox

* WIP: figuring out flaky state of local pickup enabled

* Fix flakey enable/disable local pickup

* Migrated remaining local pickup tests to Playwright

* Removed deprecated E2E

* Added changelog

* Corrected linting errors

* Fixed playwright/no-element-handle lint error

* Replace CSS IDs and classes with recommended built in locators

* Remove obsolete function calls

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2024-01-11 21:25:12 +07:00
Albert Juhé Lluveras 67fb8d7511
Add e2e tests to verify Products by Category/Tag/Attribute templates default to Product Catalog template (#43471)
* Add e2e tests to verify Products by Category/Tag/Attribute templates default to Product Catalog template

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-11 12:47:56 +01:00
Sam Seay 5fdbe63530
[Experimental] Rename Collection Filters to Product Filters (#43363)
---------
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2024-01-12 00:27:33 +13:00
Veljko V b6bdfe0572
Add new E2E tests for Shopper Cart Quantity Limit and Cross Sell Items (#43333)
* Add e2e test for shopper cart quantity limit and cross sell items

* Add changelog

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-01-10 11:36:32 -08:00
Veljko V eb49308781
Add new E2E tests to cover Shopper Checkout Block flow (#41218)
* Add few E2E tests to cover half of the milestone

* Improve welcome modal closing

* Add new test scenarios

* Add more tests to cover creating account and shipping

* Update shipping zone labels to fulfil latest design changes

* Add tests for checkout block coupons and cart block coupons

* Remove only flag leftover

* Add checkout block tax tests and merge with cart test

* Update selectors to match checkout page

* Update checkout block test and comment scenario until issue resolved

* Remove only leftover

* Update checkout block test

* Improve filling shipping and billing checkout

* Create order via API with coupon

* Include checkout filling util helper

* Update test to use get by role for alerts

* Remove only leftover

* Adjust scenario for placing an order as a customer

* Improve existing customer placing order scenario

* Add util helper for adding products to cart

* Remove leftover from testing

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-01-10 11:36:11 -08:00
Jonathan Lane 9c2048f029
Shard e2e test execution on CI (#43056)
* Try sharding e2e tests

* Update reporter for merge

* Add changelog

* Change to trigger CI

* Update job name to match existing run

* Install with dependencies

* Set working directory

* Only run 2 workers at a time on CI

* Try single run, but 6 shards

* Simplify welcome modal closing util helper

* Switch to more simpler way of closing welcome modal

* Fix flakiness in create shipping zone test

* Try 10 shards

* Drop CI retries to 2 from 4

* Update path to reports

* Fix syntax error in GH file

* Remove working directory

* Update directories

* Path again

* Use Allure dir

* Fix merge step

* Install dependencies

* Setup repo in report merge

* Commands to merge reports

* Set working directory

* Update actions

* Name upload artifacts

* Just numbers for shards

* Update matrix

* Need to redeclare env variables

* Update file paths for merge step

* Remove working directory for merge step

* Try absolute paths

* Missed a path

* Put all artifacts in single download folder

* Tweak download action

* Might not have to merge reports

* Fix typo

* Update path for summary report

* Update results paths

* Tweak condition

* Add step to check success of matrix run

* Remove ternary per feedback

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
Co-authored-by: Veljko <veljano@yahoo.com>
2024-01-10 10:42:05 -08:00
Jonathan Lane bcea0fecb9
Add conditional skip to FTUX (#43437)
* Add conditional skip to FTUX

* Changelog

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-01-10 08:33:02 -08:00
Albert Juhé Lluveras 6bc865dd9b
Add e2e tests for user customization of block templates (#43426)
* Add e2e tests for user customization of block templates

* Update instructions to run Playwright e2e tests

* Code cleanup

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

* Create revertTemplateCustomizations util

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-10 16:51:53 +01:00
github-actions[bot] b9f371c23b
Delete changelog files based on PR 43269 (#43467)
Delete changelog files for 43269

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-01-10 16:31:08 +01:00
Thomas Roberts d8331dc3f1
Add additional information block for custom checkout fields (#43274)
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-01-10 06:20:06 -08:00
github-actions[bot] 5451d1ef23
Delete changelog files based on PR 43428 (#43461)
Delete changelog files for 43428

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-01-10 14:48:57 +01:00
Jorge A. Torres 39ec01bceb
Fix PHP warning related to logging severity threshold (#43448)
* Fix PHP warning related to logging default severity threshold

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-10 13:32:35 +00:00
Bartosz Budzanowski a6705cda15
Force marketing menu items order. (#41836)
* Force marketing menu items order.

* Add changelog.

* Make sure that Overwiev is present.

* Coupons should be always second.

* Update plugins/woocommerce/src/Internal/Admin/Marketing.php

Co-authored-by: Gan Eng Chin <ecgan@users.noreply.github.com>

* Update plugins/woocommerce/src/Internal/Admin/Marketing.php

Co-authored-by: Gan Eng Chin <ecgan@users.noreply.github.com>

* Use fallback for different languages.

* Use location as a fallback for names.

* Fix linting.

* Refactor.

* Remove unneded new line.

* Remove duplicated code.

---------

Co-authored-by: Gan Eng Chin <ecgan@users.noreply.github.com>
2024-01-10 14:23:41 +01:00
Gan Eng Chin 0636a09f63
Delete old marketing recommendations transient upon update to WC 8.6.0 (#43162)
* Add MarketingRecommendations feature.

The code here is based on other feature with default fallbacks and with data source poller, e.g. see payment gateway suggestions.

* Use MarketingRecommendations feature in API.

* Add spec_key for MarketingRecommendationsDataSourcePoller.

If we don't specify it, the default is `id`, which is not used in our recommendation data, and this will cause things not to work as expected.

* Recursively convert object to array.

This is because all the subsequent functions work with arrays, not objects.

* Make recommended marketing tools and coupons use MarketingRecommendationsInit.

This is so that recommended channels, tools, and coupons make use of the same transient data with data source poller.

* Add changelog.

* Fix PHP lint issues.

* Add doc comment to fix lint error.

* Fix tests in MarketingRecommendationsTest.

* Replace recommendations.json file with generated data in DefaultMarketingRecommendations.

This is to have i18n support.

* Add icons for fallback marketing recommendations.

* Fix PHP linting issue.

* Fix linting issue.

* Fix failing tests with PHP 8.0.

* Remove unused replaced code in MarketingSpecs.

* Delete old marketing recommendations transient upon update to WC 8.6.0.

* Add changelog.
2024-01-10 21:05:36 +08:00
Chris Lilitsas e24aabff04
Introduce a new block style for the Product Details block and set it as default (#42965)
* Introduce the minimal block style for productDetails block

* Change the default style in the template

* Change the default template when using the transform-to-blocks button

* Cleanup

* Organize CSS selectors

* Add opacity on hover

* Fix specificity and add explanation

* Cleanup

* Changelog
2024-01-10 14:08:48 +02:00
Karol Manijak 30888d7f1b
Product Collection: Rename "Inherit query from template" option and make description contextual (#43270)
* Update the copy of Inherit Query from template and make it contextual

* Add changelog
2024-01-10 12:40:05 +01:00
Tung Du 8fb3d394a5
[Experimental] Add basic e2e test for new filter blocks (#43392) 2024-01-10 18:17:00 +07:00
Gan Eng Chin 6802b2720a
Add Default Fallback Marketing Channel Recommendations (#43001)
* Add MarketingRecommendations feature.

The code here is based on other feature with default fallbacks and with data source poller, e.g. see payment gateway suggestions.

* Use MarketingRecommendations feature in API.

* Add spec_key for MarketingRecommendationsDataSourcePoller.

If we don't specify it, the default is `id`, which is not used in our recommendation data, and this will cause things not to work as expected.

* Recursively convert object to array.

This is because all the subsequent functions work with arrays, not objects.

* Make recommended marketing tools and coupons use MarketingRecommendationsInit.

This is so that recommended channels, tools, and coupons make use of the same transient data with data source poller.

* Add changelog.

* Fix PHP lint issues.

* Add doc comment to fix lint error.

* Fix tests in MarketingRecommendationsTest.

* Replace recommendations.json file with generated data in DefaultMarketingRecommendations.

This is to have i18n support.

* Add icons for fallback marketing recommendations.

* Fix PHP linting issue.

* Fix linting issue.

* Fix failing tests with PHP 8.0.

* Remove unused replaced code in MarketingSpecs.

* Remove unneeded false check.

This is because `is_array` would return `false` when `false` is being passed as the argument.

Co-authored-by: Bartosz Budzanowski <bartosz.budzanowski@automattic.com>

---------

Co-authored-by: Bartosz Budzanowski <bartosz.budzanowski@automattic.com>
2024-01-10 18:39:59 +08:00
And Finally b62c3bc2f4
Do not access change_feature_enable() statically. Closes #43175. (#43428)
* Do not access change_feature_enable() statically. Closes #43175. Copy of @helgatheviking's cd71d08577.

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-10 09:43:03 +00:00
Corey McKrill 4ecbaf573c
Logging: Add settings UI to configure the logger (#42979)
* Centralize log level labels

* Fire an action specific to loading the Logs tab

* Functional settings screen (no way to navigate to it yet)

* Deprecate wc_register_default_log_handler

* Hook up the settings

* Add section nav

* Add an action hook to the settings form

* Rename render_page method to render_form

* Scaffold the unit tests

* Remove logging enabled check from WC_Logger construct

Caching the enabled setting value turns out to not be a great idea,
it breaks some tests, and could cause issues if the setting value
changes, and then a logging event happens later in the same request.

WP has its own caching layer for options anyway, but one that will
update if the value of the option changes. So this just makes the
enabled check directly from the should_handle method.

* Add most unit tests. Still needs a couple more

* Add remaining unit tests

* Update since values on new hooks to 8.6.0

* phpcs cleanup

* Change deprecated tag from 8.5.0 to 8.6.0

* Add missing return types to unit tests

* Add changelog file

* Add missing clear method to new log file handler

* Change level_threshold default value to 'none'

* Ensure logger has a valid level threshold set, regardless of level given

* Update legacy unit test

* Ensure settings only saved on settings view

* Add settings sections for filesystem and database

Also add a filesystem setting for collapsing log entry lines.

* Add public LoggingUtil class for external usage, and use in WC_Logger

* Remove unused import

* Deprecate wc_get_log_file_path and wc_get_log_file_name

* Preserve white space in log file lines

It turns out that several extensions add log entries that are just
a print_r of an array. Preserving the white space is important for
making this data legible (ideally they'd switch to adding this data
within the context parameter)

* More legacy unit test fixes

* Remove entry collapse option and functionality

It's unclear right now that entry collapsing provides much real
benefit, while it clearly does have some potential drawbacks if
extensions are in use that add print_r output to the log files.

* phpcs cleanup

* Yet more unit test tweaks

* Remove unused code

* Don't wrap extra handler options in <code>, it gets excaped

* Attempt fix for WC_Tests_Logger::test_clear

This is only failing on GH CI, not when running locally. Maybe
ensuring all the created log files are deleted will help.

* Improve logging of fatal errors

This improves the formatting of error messages caught and logged
during shutdown to be more legible and to take advantage of the
logging method's context parameter. With this change, the log entry
will be a simple message on one line, and any stack trace will be
available but hidden in an "Additional context" details element.

* Tweaks to some settings' wording

* Update webooks link to logs, undeprecate

* Remove `realpath` usage since it deos not work if log directory does not already exists.

---------

Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
2024-01-10 14:44:05 +05:30
Alba Rincón a38c7bcccf
CYS: fix PHP warnings and pattern button (#43354)
* Remove custom styles from button

* Avoid php warning about images and slug not defined

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

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

* Fix linting errors

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-10 09:03:56 +01:00
berislav grgičak c018d7751b
Redirect Woo.com connect request to selected page (#43315)
* Working redirect

* Dynamic connect urls

* Clean up

* Changelog
2024-01-10 07:20:15 +01:00
Chi-Hsuan Huang 2c122ba446
Track core profiler individual plugin installation success/failure (#43309)
* Track core profiler individual plugin installation success/failure

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

* Log coreprofiler_store_extension_installed_and_activated async failures

* Log coreprofiler_store_extension_installed_and_activated sync success

* Rename track prop key

* Track error_message for recordFailedPluginInstallations

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-10 11:48:34 +08:00
Maikel Perez 1ad48760c9
Redirect supported product types to the new experience based on the product template associated to it (#43341)
* Redirect supported product types to the new experience based on the product template associated to it

* Add changelog file

* Fix linter error

* Redirect using the product type first and then the associated product template

* Set the product template id also for unsupported product templates

* Add changelog file

* Remove supported_product_types from the RedirectionController since the product_templates is used instead

* Fix php linter error
2024-01-09 18:31:25 -03:00
Alejandro López Ariza ed015e5485
Update stable tag to 8.4.0 (#43425)
woorelease: Update stable tag to 8.4.0
2024-01-09 16:51:08 +01:00
Luigi Teschio 1453597400
CYS - Core: implement 'noAI' flowType (#43368)
* CYS - Core: implement 'noAI' flowType

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

* remove unused import

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-09 15:49:59 +01:00
Ismael Martín Alabarce 45377e63be
Update WooPayments task copy (#43365)
* Update WooPayments task copy

* Add changelog

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-09 12:43:47 +01:00
Alejandro López Ariza 937b6d66c8
Update stable tag to 8.5.0 (#43402)
woorelease: Update stable tag to 8.5.0
2024-01-09 11:21:42 +01:00
Daniel Dudzic 3be8264c5d
[Experimental] Product Gallery Pager: Improve accessibility (#43348)
* Product Gallery Pager: Improve accessibility

* Product Gallery Pager: Fix number pager styling
2024-01-09 10:48:49 +01:00
Denis Dvali aa4fda8b27
Remove v1 of plugin installer (#37893)
* Remove v1 of plugin installer.

* Rename WC_REST_WCCOM_Site_Installer_Controller_V2 into WC_REST_WCCOM_Site_Installer_Controller.

* - Create base controller for WCCOM Site requests, extended by Installer and SSR controllers.
- Switch get SSR endpoint to v2 namespace.

* Remove namespace property from Installer controller.

* Linting.

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

* Switch request method of reset install endpoint to POST (#43150)

- Switch reset installation state request to POST.
- Change wccom-site API namespace to v3.

* Exclude deleted files from linter check (#43355)

Exclude deleted files from linter check.

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-09 09:23:13 +00:00
Tom Cafferkey b58a1932fe
Block Hooks API: Abstract Block Hooks code into a separate trait class (#43250)
Co-authored-by: github-actions <github-actions@github.com>
2024-01-09 08:41:42 +00:00
github-actions[bot] 4f6f7aa8c6
Delete changelog files based on PR 43344 (#43388)
Delete changelog files for 43344

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-01-09 00:05:51 +00:00
Alexandre Lara 65d9c6764c
[Experimental] Product Gallery block: Rename media setting to "Open pop-up when clicked" (#43302)
* Rename media setting to "Open pop-up when clicked"

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-08 16:58:27 -03:00
Gan Eng Chin 8b1df6c946
Fix "rm: .git/hooks: No such file or directory" error in `pnpm install` when the directory is missing (#43142)
* Fix "rm: .git/hooks: No such file or directory" error in `pnpm install`.

* Add changelog.

* Use "rm -rf" instead of "test" command on .git/hooks directory.

We use the "-f" flag so that it does not throw error when the directory does not exist.
2024-01-08 14:13:42 -04:00
jonathansadowski ce3a38ac55
Try reducing blocks build size (#43344)
* Try reducing blocks build size

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

* Only set NODE_ENV if its not already defined

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-08 11:33:49 -06:00
Tomek Wytrębowicz fa62e63037
Make OSA fields extendable, simplify naming (#41690)
- Use `referrer` & `source_type` field names consistently
   Remove the need to translate it back and forth.
- Make fields actually extendable using `wc_order_attribution_tracking_fields`.
   Propagate the field configuration to the client side as well.
   Disambiguate fields in variables and functions.

Co-authored-by: Justin Palmer <228780+layoutd@users.noreply.github.com>
2024-01-08 16:17:04 +01:00
Jorge A. Torres ebb6b0fe54
Fix possible duplication in certain HPOS related Tracks events (#43318)
* Fix possible duplication of HPOS related Tracks events

* Add changelog
2024-01-08 20:12:37 +05:30
Thomas Roberts c159e8a858
Update Checkout Fields error reporting to use `_doing_it_wrong` instead of wc logger (#43283)
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2024-01-08 03:16:08 -08:00
Karol Manijak 8d4f1cecec
Product Collection: Make sure all variations are taken into account when choosing collection (#43273)
* Make sure all variations are taken into account when choosing collection

* Add changelog
2024-01-08 10:55:42 +01:00
Tung Du aab950e27a
[Experimental] Add: Filter blocks migration (#43218)
* add: upgrade panel

* add: toolbar upgrade button

* add: downgrade panel

* chore: changelog

* refactor: move the upgrade component to `Collection Filters` block
2024-01-08 16:31:06 +07:00
Tung Du 823a35a9f2
[Experimental] Add: notice informing users about the usage of filter blocks (#43262) 2024-01-08 13:43:12 +07:00
Sam Seay 1eba9c62a8
Add lint config to blocks to lint imports (#43310) 2024-01-08 18:32:15 +13:00
Maikel Perez a7627fbf0e
Linked product list empty state (#43163)
* Add product search field to the linked product list block

* Add empty state to the linked product list block

* Fix AdviceCard styles

* Create skeleton for the linked product list block

* Fix linter errors

* Move the product list skeleton to the product list component folder

* Revert AdviceCard changes

* Remove upsells and cross-sells block to use linked-product-list block instead

* Add changelog files
2024-01-05 15:26:06 -05:00
Corey McKrill f8b906000f
Remove usage of PHP 8+ function from bootstrapper (#43308)
(PHP 7.4 compat) string lib polyfills are unavailable during bootstrapping.
2024-01-05 12:03:12 -08:00
Roy Ho 6ef04bafa5
Hide sale badge if product image is disabled (#43334)
* Hide sale badge if product image is disabled

* Fix css target to cover all product grid

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

* Hide on sale badge via PHP side

* Remove css changes

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-05 11:16:37 -08:00
Seghir Nadir e50e7799c0
Support additional fields in the Contact step for Checkout (#43088)
* add custom fields to contact info step

* fix linting

* add changelog

* adjust fields validation

* address review changes

* address sanization and validation

* fix billing address shape

* address schema issues

* cast address to array

* dont sanitize stuff that will validated

* fix linting issues

* fix cart unit test

* revert test

* fix the email issue
2024-01-05 18:35:28 +01:00
Alba Rincón 5752bd7a9f
Fix CYS updateStorePatters to use the new images endpoint structure (#43285)
* Return the correct empty images response

* Use the correct structure in the images endpoint response

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

* Throw error when no images and the store is already ai generated

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-05 17:56:51 +01:00
Matt Sherman 9ba256235a
Fix @woocommerce/block-templates changes not being picked up on build (#43328) 2024-01-05 11:44:25 -05:00
Luigi Teschio 3978be9fdd
fix - Product Button: don't trigger jQuery add to cart function when the button is clicked on classic themes (#43325)
* fix - Product Button: don't trigger old add to cart function when the button is clicked on classic themes

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

* improve E2E tests

* update changelog

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

* update changelog

* use beforeEach

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-05 17:34:16 +01:00
Roy Ho 8bbb35d63e
[Experimental] Product Gallery: Use @container rule to adjust overlay link count font size (#43294)
* Product Gallery: Use @container rule to adjust overlay link count font size

* Add changelogs

* Remove em from line height

* Make view all link smaller
2024-01-05 07:23:19 -08:00
Albert Juhé Lluveras 67ddade2fd
Delete woocommerce-gutenberg-products-block.php file (#43319)
* Delete woocommerce-gutenberg-products-block.php file

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-05 15:32:15 +01:00
louwie17 62e2b53a55
Fix highlight tooltip deprecation notices (#43303)
* Remove deprecated achorRect and IsolatedEventContainer usage

* Add changelog

* Remove unused code

* Add option for shouldCloseOnClickOutside
2024-01-05 08:35:06 -04:00
Tung Du 37c94c7604
[Experimental] Fix: get the correct min/max price for filtering (#43313) 2024-01-05 17:19:33 +07:00
Saad Tarhi 009ff8707b
Move shopper-side Cart E2E tests to Playwright (#42897)
* Convert empty cart E2E test

* Convert product removal E2E test

* Convert quantity update E2E test to Playwright

* Convert E2E tests of the remaining methods that update cart quantity

* Convert E2E test: Proceed to Checkout

* Convert E2E test: Cross-Sells

* Remove test files

* Update plugins/woocommerce-blocks/tests/e2e/tests/cart/cart-block.shopper.block_theme.side_effects.spec.ts

Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>

* Set up cross sells products before e2e test

* Solve merge conflict

* Add changelog entry

* Remove obsolete import

---------

Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
2024-01-05 17:15:23 +07:00
Albert Juhé Lluveras b07005afd1
Fix commands with tags breaking the command palette (#43269)
* Fix commands with tags breaking the command palette

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-05 10:41:37 +01:00
Tung Du af2dedb137
[Experimental] Filter blocks: add the navigate function back (#43287)
* fix: add the navigate function back

* fix: move the navigate function to a dedicate file only for frontend use
2024-01-05 14:33:43 +07:00
Niels Lange 413fb72630
Fix broken link to internal *.md file. (#43261) 2024-01-05 10:48:36 +07:00
Tarun Vijwani 2b0da27fd0
Update generic incompatibility notice (#42751)
* Move the switch to classic shortcode block button to separate component

- Move modal component file from incompatible-extension-notice component folder to switch-to-classic-shortcode-button folder.
- Rename modal component file to model-content component file.
- Move the switch to classic shortcode block button to separate component folder

* Update generic incompatibility notice

- Update the notice description.
- Add switch to classic shortcode block button to the notice.

* Fix margin in editor.scss

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

* Update class names in switch-to-classic-shortcode-button component

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

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

* Update plugins/woocommerce-blocks/assets/js/editor-components/switch-to-classic-shortcode-button/editor.scss

Co-authored-by: Niels Lange <info@nielslange.de>

* Refactor SwitchToClassicShortcodeButton component

* Fix css lint erros

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

* Add type property to notice events

* Refactor switch to classic shortcode button logic

* Use isCart for switchButtonLabel and snackbarLabel

* Remove empty div in sidebar compatibility notice component

* Refactor switch to classic shortcode button event handling

* Adjust wording

* Adjust marging and readability

* Introduce union for SwitchToClassicShortcodeButtonProps type prop

* Simplify logic

* Use proposed text

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2024-01-05 10:47:34 +07:00
Corey McKrill 68c147a491
Settings: Make minor corrections to the HTML markup of settings fields (#43166)
* Corrections to HTML markup of settings controls

* Remove deprecated `valign` attributes from table row elements
* Remove orphaned quotation marks from the end of table row elements

Co-authored-by: Sagehen Studio <2924107+sagehenstudio@users.noreply.github.com>

* Enable title prop for `info` setting type

This gives the `<th>` for the info setting type a closing tag
since its not self-closing. It also allows for adding a `title` prop
to the info setting type, to match all the other setting types.

* Add changelog file

* phpcs cleanup

---------

Co-authored-by: Sagehen Studio <2924107+sagehenstudio@users.noreply.github.com>
2024-01-04 16:08:31 -08:00
github-actions[bot] 88d71aa9c8
Delete changelog files based on PR 43257 (#43291)
Delete changelog files for 43257

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-01-04 17:08:52 +00:00
Damián Suárez 17c8354ad9
[Product Block Editor]: Be able to dismiss AdviceCard instances (#43124)
* introduce packages/js/data/src/user/types.ts pref

* be able to dismiss the Upsells advice

* rename user pref key

* typify product_advice_card_dismissed prop

* store is dismissed state in the user pref

* delegate the dismiss state to the component

* changelog

* remove console.log :'(

* fix TS issue

* fix TS issue

* changelog
2024-01-04 12:17:03 -03:00
Alexandre Lara bffe12b945
Product Gallery block: Fix e2e tests for Thumbnails block (#43060)
* Fix e2e tests for thumbnails change

* Add changelog
2024-01-04 10:38:32 -03:00
Maikel Perez f34bb52f9e
Linked product list (#43145)
* Create and register product-linked-list-field block

* Add upsells and cross-sells blocks to the simple product template

* Create formatted price component

* Add linked product table to the linked product list block

* Add remove product button to each product row

* Add see product page button

* Add link to the product name so it can be edited in a new tab

* Fix some styles

* Add product search field to the linked product list block

* Fix styles

* Add changelog files

* Fix linter error

* Fix rebase conflicts

* Use useProductEntityProp instead of useEntityProp within product-linked-list-field block

* Move the product list to its own component

* Move the product select to its own component

* Move the product image to its own component

* Fix linter error
2024-01-04 08:34:53 -05:00
Niels Lange 0cffd32875
Remove old noticed on classic checkout when applying coupon code (#43244)
* Remove old noticed on classic checkout when applying coupon code

* Remove old noticed on classic checkout when applying coupon code

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-04 12:31:00 +01:00
Alba Rincón f528361ec2
Show default patterns and products if the images request fails (#43157)
* Show default patterns and products if the images request fails

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

* Remove space

* Simplify condition

* Removed unused call

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-04 12:11:00 +01:00
Karol Manijak 4128bff64c
Fix incorrect layout of Product Collection placeholder on Firefox (#43264)
* Fix incorrect layout of Product Collection placeholder on Firefox

* Add changelog
2024-01-04 11:20:57 +01:00
Alba Rincón 9d86e1f038
Remove the double quotes from the AI generated content before saving it (#43249)
* Remove the double quotes from the AI generated content before saving it

This will avoid having two consecutive double quotes and breaking the JSON.

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

* Fix lint error

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-04 09:47:28 +01:00
Kyle Nel 4428d81b12
Display ratings on marketplace product cards (#43240)
* Add rating and change product card layout

* Fix some minor CSS bugs in existing code

* Implement skeleton loader

* Update theme card styling to match design

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


---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-04 10:07:00 +02:00
Sam Seay faf1c6f09e
[Experimental] Use variations to provide all the product filters wrapped by CollectionFilters block (#43216)
---------
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2024-01-04 18:33:59 +13:00
Siddharth Thevaril a6ea063cba
Fix payment gateway doc (#43238)
* Fix namespace

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-04 12:07:07 +07:00
Tung Du de1d60ebe4
[Experimental] Add Widget support to new collection filter blocks (#43153) 2024-01-04 11:56:24 +07:00
Sam Seay 73160b3c41
[Experimental] Filter out filter options that would result in 0 products. (#43220) 2024-01-04 17:23:40 +13:00
kevinbates 7f7515aa1c
Update readme.txt (#43257)
* Update readme.txt : updated the intro text and added 3 links.

* Changelog.

---------

Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
2024-01-03 19:18:57 -08:00
Leif Singer a81cfff412
Add tests for searching for multiple term IDs (#43089)
* correct copy/paste error

* test searching by multiple tag IDs

* test searching by multiple category IDs

* add the changelog file
2024-01-03 19:18:22 -08:00
Matt Sherman a8dab20997
Layout templates REST API (#43067)
* Endpoint shell

* Single layout template route

* Add area query arg

* Fix BlockTemplateRegistry::get_registered() return type

* Check if templates are registered before registering

* Use json format for layout templates response

* Remove unused use

* Use json format for layout templates response for get_items

* Consolidate processing for get_items and get_item

* LayoutTemplateRegistry

* Fix matching by id

* Get templates from LayoutTemplateRegistry

* Remove unused method

* Fix typo in code doc

* Move template instantiation to registry

* Return template instance, not json when instantiating

* Use LayoutTemplateRegistry instead of BlockTemplateRegistry

* Add code docs for rest controller

* Fix code doc in BlockTemplateRegistry

* Code docs for LayoutTemplateRegistry

* Changelog

* Add code doc for LayoutTemplatesServiceProvider

* Unit test for registering a layout template

* Unit tests for invalid params when registering layout template

* Unit test for layout template instantiation

* Unit test for instantiating layout templates with query params

* Unit test for layout template instance caching

* Cache layout template instances

* Refactor layout template info querying

* Add unit test for layout template instantiation actions

* Add before and after layout template instantiation actions

* Use layout template ID for array key

* REST API unit test to get all items

* Unit test for unregister_all

* Method to unregister all layout templates

* REST API unit test to get all items for a specific area

* Fix to_json() in TestLayoutTemplate

* REST API unit test to get single item

* Fix get_item

* REST API unit test for single item with invalid id

* REST API unit test for get all items for invalid area

* Fix test_cached_instances - array access

* Test that old register hook is called

* Call old register hook

* Remove before hook (will put in separate PR)
2024-01-03 20:02:38 -05:00
Denis Dvali 280fe7cd51
Fix occurrences where Installer_Error exception is returned instead of being thrown (#43108)
* Fix occurrences where Installer_Error exception is returned instead of being thrown.

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

* Add @throws tag in function comment.
2024-01-03 14:59:08 -08:00
Tomek Wytrębowicz 70b22764a9
Fix Consent API integration with OSA (trunk-based) (#43012)
- Stop tracking order attribution when the consent is revoked on the same page.
   Switch `wp_consent_type_defined` to VanillaJS event, as this is what the latest Complianz dispatches.
   Remove jQuery dependency.
   5427807509
- Update checkout block data when consent is given/revoked on the same page
   263d0b8a14
- Register WPConsentAPI integration for OrderAttribution
   cde9f642a1
- Don't store empty meta values for order attribution 
   If no values at all are sent, don't create meta records
   00b83eed00
- Don't translate or add parenthesis to unknown placeholder
   bbc4b1f699
- Un-hardcode marketing category in wp-consent-api-integration.js
   45014a715a

Co-authored-by: Justin Palmer <228780+layoutd@users.noreply.github.com>
2024-01-03 22:36:35 +01:00
Damián Suárez b6f8ab94f5
[Woo beta tester]: add User Preference panel (#43125)
* introduce UserPreference panel

* render user preference panel

* expose UserPreferences type

* introduce force mode to update user pref

* rename global object with `__wcbt`

* changelog

* changelog
2024-01-03 17:42:18 -03:00
rodelgc 12e65af8ca
Fix WooAF changelog typo and release date (#43254)
* Fix typo

* Fix `acceleratedReleaseDate` output

* Comment unnecessary steps, jobs

* Do only a dry-run

* Revert "Do only a dry-run"

This reverts commit a41ea99401.

* Revert "Comment unnecessary steps, jobs"

This reverts commit 97985a0ad0.

* Add changelog
2024-01-03 12:56:39 -06:00
Albert Juhé Lluveras 263011bdd2
Prevent Command Palette scripts to enqueue unnecessary scripts in the editor (#43221)
* Prevent Command Palette scripts to enqueue unnecessary scripts in the editor

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

* Properly set script asset dependencies

* Create util function to simplify the code

* Fix JS warning when registering WooCommerce Commands

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-03 18:07:43 +01:00
Daniel Dudzic 7163d610e5
Product Gallery: Fix Large Image snapping position on window resize (#43251)
* Product Gallery: Fix Large Image snapping position on window resize

* Product Gallery Snap Fix: Add changelog
2024-01-03 17:46:43 +01:00
Niels Lange ce625318cf
Update contributors list (#43182)
* Update contributors list

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

* Add changelog entry

* Add contributors of WooCommerce Beta Tester

* Delete duplicate changelog entry

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-03 18:02:30 +07:00
Michael Pretty e7647333a1
Fix bug when searching orders with a term starting with d, s, or f (#43085)
* Don't prepare the order search $meta_sub_query twice.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Nestor Soriano <konamiman@konamiman.com>
2024-01-03 11:49:17 +01:00
Sam Seay 187780905f
[Experimental] Use CheckboxList component in interactivity attribute filter (#43217) 2024-01-03 22:58:57 +13:00
Sam Seay 161bf51bd3
[Experimental] Allow overriding placeholder in interactivity Dropdown::render (#43211)
* add: multiple select support to attribute dropdown
* fix: remove active filter from dropdown
* chore: remove unused extractBuiltinColor

---------
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2024-01-03 20:52:45 +13:00
Tung Du 97e4c55aeb
[Experimental] Rating Filter block: fix wrong import path (#43198) 2024-01-03 09:31:50 +07:00
Alexandre Lara 44e4a75419
[E2E Tests] Product Gallery > Thumbnails block: Refactor code to remove unnecessary wait for timeout (#43180)
* Refactor code to remove unnecessary wait for timeout

* Add changelog
2024-01-02 16:29:37 -03:00
Alexandre Lara e968c329c6
Add e2e tests for image transition in Product Gallery block (#43095)
* Add e2e tests for image transition in Product Gallery block

* Create e2e tests for the Product Gallery block when it is inside the pop-up

* Add changelog

* Remove unnecessary lodash dependency import
2024-01-02 16:19:28 -03:00
Alba Rincón f9cdce486a
Increase Pexels product images width to 400px to have a better resolution (#43174)
* Increase product images width to 400 to have a better resolution

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-02 13:59:38 +01:00
Sam Seay 5de0f4a274
[Experimental] Refactor the interactivity dropdown to remove dependence on FormTokenField (#43183)
* Also fix https://github.com/woocommerce/woocommerce/issues/43154
2024-01-02 17:13:27 +13:00
github-actions[bot] e43eb1dcab
Delete changelog files based on PR 43177 (#43203)
Delete changelog files for 43177

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-01-01 23:05:34 +00:00
Sam Seay 7619549091
Check if WOOCOMMERCE_BLOCKS_PHASE is set inside build-zip script. (#43169) 2024-01-01 17:20:01 +13:00
Tung Du bd9ddc830a
[Experimental] Add: QueryFilters class to calculate filter data for product queries (#42811)
* add: query filters count class

* chore: method comments

* refactor: rename class to QueryFilters

* fix: price filter count

* fix: price filter url

* chore: remove unnecessary transformation

* chore: remove unused meta query filter

* chore: put public methods on the top of the class

* fix: passing $wp_query

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

* fix: stock query clause

* fix: handle and query type for attribute filter

* fix: ensure passing non null value to floor/ceil

* [Experimental] Collection Filter blocks: ensure the namespace is always rendered (#43112)

* fix: ensure the namespace is always rendered

* fix: target only wc queries

* fix: properly reset part of query to make new filter blocks work with Product Collection block
2024-01-01 10:18:50 +07:00
Albert Juhé Lluveras c58b0cf936
Fix error when adding to cart from the Product Collection block if Google Analytics plugin is enabled (II) (#43177)
* Revert "Trigger event `experimental__woocommerce_blocks-cart-add-item` in the SSR Product Button vis Interactivity API (#42946)"

This reverts commit 4fec136da1.

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-29 17:23:35 +01:00
Alexandre Lara 4efd2123a3
[Docs] Update links from WooCommerce.com to Woo.com for the Woo Blocks documentation (#43055)
* Update woocommerce.com URLs in documentation and code files

* Add changelog

* Fix github repository link in extend-rest-api-add-custom-fields.md

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* Add github reporter (#42974)

* Add github reporter

* Add changelog

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>

* Fix product task redirect to support grouped and external products (#43051)

* Rearrange product redirection logic to better accept grouped and external produc types

* Add changelog

* Modify feedback modal actions (#43005)

* Adapt feedback modal actions

* Add changelogs

* Modify comments

* Fix tests

* Fix test

* Update class-wc-gateway-bacs.php (#43054)

* Update class-wc-gateway-bacs.php

Fix typo in textdomain

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

---------

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

* [Product Block Editor]: Add `Linked product` tab (#43009)

* add linked-products to group IDs

* add Linked Products tab

* tweak hideConditions condition

* changelog

* fix typo in doc comment

* Introduce a product type selection within the new experience (#41823)

* Create a relation between the product type and the product block template

* Add 'patterns' to name the kind of products that can be created for a specific template

* Resolve template using its id as a template query param

* Rename ProductEditPattern to ProductTemplate

* Rename get_patterns hook to woocommerce_product_editor_get_product_templates

* Return the list of templates to the client

* Set layout template events as array

* Register the layout template based on the product template or the post type in case of product variations

* Registering non supported product types

* Create and register the woocommerce/product-details-section-description block

* Add the product type to the section description

* Create product type selector

* Fix menu item style

* Highlight selected menu item

* Set the selected product template

* Set product template title to lowercase in the content description

* Rename blocks by blockTemplates under the AbstractBlockTemplate class

* Rename to woocommerce_product_editor_product_templates filter

* Remove product_template_ prefix from the supported_product_types map

* Rename get_formatted to to_JSON and convert the props to client side like

* Refactor get_product_templates

* Fix icon resolution

* Add a confirmation modal for unsupported product templates

* Add changelog files

* Remove product types using for testing

* Fix redirection when changing to a non supported product template

* Set the change button state to busy when it is saving the product

* Fix php linter errors

* Fix rebase conflict

* Move ProductTemplate to Automattic\WooCommerce\Admin\Features\ProductBlockEditor namespace

* Add the to_json definition to the BlockTemplateInterface

* Create default product template by custom product type if it does not have a template associated yet

* Fix some comments and product template creation validation

* Add support to load the product template icon from an external resource

* Fix php linter

* Fix the changelog description

* [Experimental] Interactivity Dropdown multi-select mode, ratings filter and introduce each directive (#42981)


---------
Co-authored-by: David Arenas <david.arenas@automattic.com>

* Introduce the transient files engine (#42877)

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

* Change marketplace install API request to POST instead of GET (#43033)

* Change marketplace install API to using POST instead of GET
* Fix linting error
* Add changefile(s) from automation for the following project(s): woocommerce

---------

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

* Prep trunk for 8.6 cycle (#43021)

Prep trunk for 8.6 cycle with version bump to 8.6.0-dev

Co-authored-by: WooCommerce Bot <no-reply@woo.com>

* Add Playwright tests for All Reviews, Reviews by Product and Reviews by Category blocks (#42903)

* Remove Reviews blocks Puppeteer tests

* Minor code cleanup

* Typos

* Create publishAndVisitPost() editor util

* Fix subcategories when importing products in Playwright and add reviews

* Add Reviews blocks tests in Playwright

* More typos

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

* Create a 'reviews' object in data.ts so we can store reviews data in one single place

* Update test so instead of creating a new post in each test, we go to the already-created post

* Add source comments to reviews data to match it with the script

---------

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

* Release: Remove 8.5 change files (#43022)

Delete changelog files from 8.5 release

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
Co-authored-by: Alex López <alex.lopez@automattic.com>

* Delete changelog files based on PR 43033 (#43079)

Delete changelog files for 43033

Co-authored-by: WooCommerce Bot <no-reply@woo.com>

* Delete changelog files based on PR 43051 (#43081)

Delete changelog files for 43051

Co-authored-by: WooCommerce Bot <no-reply@woo.com>

* Interactive Price Filter: use `context` instead of `state` (#42980)

* feat: use context instead of state

* fix: temporary move the context to inner element for diffing to work

* fix: update context before navigation for optimistic UI

* Load google analytics gtag script asynchronously in WooCommerce Blocks (#43040)

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

* set WOOCOMMERCE_BLOCKS_PHASE to 1 for the production build (#43074)

* set WOOCOMMERCE_BLOCKS_PHASE to 1 for the production build

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

---------

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

* Revert "Fix schedule sales error" (#43094)

Revert "Fix schedule sales error (#42700)"

This reverts commit 9b800aa179.

* [Product Block Editor]: add Linked product sections. First approach. (#43013)

* add Linked products, Upsell section

* changelog

* add Cross-lens section

* add links to the Upsell sections

* changelog

* fix lint issues

* fix lint issus

* fix linting issue :-|

* check whether the linked product group is defined

* [Product Block Editor]: introduce ShoppingBags component (#43042)

* add ShoppingBags component

* Add ShoppingBag story

* changelog

* Fix: Collection data being leaked between Collection Filters blocks (#43044)

* fix: CYS - change heading color (#43076)

* fix: CYS - change heading color

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>

* Delete changelog files based on PR 43074 (#43118)

Delete changelog files for 43074

Co-authored-by: WooCommerce Bot <no-reply@woo.com>

* [Product Block Editor]: fix feature flag to hide the Linked products (#43119)

* fix flag to hide/show product editor

* changelog

* Add changelog

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Jonathan Lane <lanej0@users.noreply.github.com>
Co-authored-by: Jon Lane <jon.lane@automattic.com>
Co-authored-by: louwie17 <lourensschep@gmail.com>
Co-authored-by: Fernando Marichal <fernando.marichal@automattic.com>
Co-authored-by: Marc Guay <marc.guay@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Damián Suárez <rdsuarez@gmail.com>
Co-authored-by: Maikel David Pérez Gómez <maikel.perez@automattic.com>
Co-authored-by: Sam Seay <samueljseay@gmail.com>
Co-authored-by: Néstor Soriano <konamiman@konamiman.com>
Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
Co-authored-by: Kyle Nel <22053773+kdevnel@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: WooCommerce Bot <no-reply@woo.com>
Co-authored-by: Alex López <alex.lopez@automattic.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-12-29 12:28:11 -03:00
Manish Menaria 1ed5d0872a
Fix: Enable Pagination Block Visibility in Product Collection Block (#43132)
* Fix: Enable Pagination Block Visibility in Product Collection Block

This commit resolves an issue where the Pagination block was not visible in the block insertor within the Product Collection block.

- The core query pagination block name, initially hardcoded, is now declared as a constant `coreQueryPaginationBlockName` in `constants.ts`. This change not only improves code readability but also ensures consistency in using the block name across different files.

- In `index.tsx`, the `addProductCollectionBlockToParentOfPaginationBlock` utility function from `utils.tsx` is imported and executed. This function plays a crucial role in the fix. It dynamically adds the Product Collection block to the parent array of the Core Pagination block, ensuring the latter's visibility in the insertor when editing the Product Collection block.

- The utility function employs WordPress hooks and version checks to gracefully handle different WordPress environments. This careful approach maintains backward compatibility while addressing the current issue.

With these changes, merchants can now easily add a Pagination block from the insertor while working on the Product Collection block, enhancing the user experience and functionality.

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-29 15:45:29 +05:30
Jorge A. Torres 69a864af67
Update tracks events hooks for HPOS (#42879)
* Update ‘orders_view’ tracks event for HPOS

* Update ‘orders_view_search’ tracks event for HPOS

* Update ‘order_edit_date_created’ tracks event for HPOS

* Update ‘order_edit_add_order’ tracks event for HPOS

* Correctly enqueue order tracking JS scripts when HPOS is active

* Address TS script

* Change add_filter() to add_action()

* Fix tests

* Add changelog

* Fix some linting issues

* Make PHPCS happy

* Better handle deprecating old method

* Fix condition
2023-12-29 08:46:59 +00:00
Manish Menaria 5d5fc57e8c
Fix: migration issues when transitioning from Products (Beta) block to Product Collection block (#43130)
* Update product query block templates with WooCommerce namespace

It modifies the `<wp:post-template>` block in multiple files to include a new attribute: `{"__woocommerceNamespace":"woocommerce/product-query/product-template"}`.

The inclusion of the `__woocommerceNamespace` attribute is a strategic enhancement, ensuring that these block templates are explicitly recognized as part of the WooCommerce namespace.
This fix the issue where migration from Products beta block to Product Collection block doesn't work properly.

* Fix linting error

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-29 12:09:12 +05:30
Jorge A. Torres 9ce04dc807
Add hook to exclude certain properties from HPOS sync/verification (#43123)
Certain order properties (or metadata) are not relevant for HPOS verification. For example, `_edit_lock` which is an ephemeral key. So far we've been hardcoding these keys in various places. This provides a new API to access these keys. It also introduces hook `woocommerce_hpos_sync_ignored_order_props` which allows 3rd party code to add new keys to be ignored by sync/verification code.

Fixes #41907
2023-12-28 10:40:02 -08:00
Sam Seay eabb27c72b
[Experimental] Add block text color support to interactivity filter blocks (#43068)
* [Experimental] Render headings as inner blocks of collection filters (#43109)
2023-12-29 03:06:35 +13:00
Damián Suárez b36023e8aa
[Product Block Editor]: render empty state for the Cross-sells section (#43143)
* introduce cross-sells product field block

* export Cross-sell block

* add Cross-sells block instance into the Cross-sell section

* fix importing image bug

* changelog

* changelog

* remove unexpected console.log instance
2023-12-28 09:06:01 -05:00
Tarun Vijwani 2749cebf7f
E2E tests migration: Backend mini-cart tests to Playwright (#43093)
* Migrate Backend mini-cart tests to Playwright

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-12-28 14:33:53 +04:00
Corey McKrill 718978f840
Logging: QoL improvements to the single file view (#43146)
* Clear line highlight with a click

* Vertically center log file line when selected

* Add changelog file
2023-12-28 09:31:31 +00:00
Niels Lange 8e7c5cca1c
Show rating stars for the cross-sells products (#43069)
* Show rating stars for the cross-sells products

* Fix typo introduced in #43116 (#43148)

* Fix typo introduced in #43116

* Add changefile(s) from automation for the following project(s): @woocommerce/product-editor

---------

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-28 16:20:07 +07:00
Damián Suárez 35a4f077cf
[Product Block Editor]: render empty state for the Upsells section (#43116)
* Upsells block: scafolding

* export Upsells block

* add Upsells block into the Upsells section

* render empty state for the Upsells section

* iadd hardcoded isEmpty flag

* changelog
2023-12-27 19:40:03 -03:00
Damián Suárez b41ecfe33d
[Product Block Editor]: update the conditions to hide the Cross-sells section (#43140)
* update the conditions to hide Cross-sells section

* changelog

* fix eslint issues
2023-12-27 19:39:16 -03:00
Patricia Hillebrandt de9322fb38
[CYS] Update the neutral color palette to black and white (#43114)
* Update the neutral color palette to black and white.

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-27 09:30:08 -03:00
Patricia Hillebrandt 589617a41d
CYS > Update AI-generated site title, image optimizations and updated directory structure (#43086)
* Remove the last business description check to allow repetition.

* Create the new AIContent directory and update the structure and name of the classes.

* Ensure the store title is updated with new AI-generated content if the previous title was also AI-generated.

* Return if the images result in error.

* Update the name of the option for fetching the AI generated site title.

* Introduce the new adjust_image_size method for shared usage between products and patterns.

* Increase the quality of images used in patterns

* Introduce the ContentImageProcessor class.

* Undo PatternsHelper rename

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

* Address lint errors

* Ask AI to summarize the business description if the number of characters provided by the user is bigger than 150 characters.

* Rename the ContentImageProcessor class to ContentProcessor and introduce the new summarize_business_description method.

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-27 08:33:37 -03:00
Karol Manijak 37155abb0c
New flow of adding Product Collection and basic set of Collections (#42696)
* Migrate PR to Core

* Migrate test changes

* Add Custom Collection with inherit query attribute disabled

* Update copy of Product Catalog collection

* Don't choose default active collection in polaceholder and remove highlight

* Remove inherit query option from inspector controls

* Add collection names to Product Catalog and Custom one

* Unify Collection Chooser between Modal and Placeholder

* Bring back util removed by accident

* Replace the translations domain with woocommerce

* Remove leftovers after merge

* Add pagination and no results to Product Catalog and Custom collections

* Revert textdomain change

* Fix lint error

* Add changelog entry

* Change collection label

* Bring back Inherit query from template

* Remove Custom collection and bring back single Product Collection

* Simplify applying collection

* Make sure Inherit query from template is enabled in archive templates by default and disbaled in posts/pages

* Change incorrect Playwright locator

* Add test for Product Catalog inheriting the query in product archive

* Add tests for recommendation collection hiding the predefined filters

* Add reviews to multiple products

* Update expected products in Top Rated

* Remove rating creation in test env and skip undeterministic tests

* Add skip to Best Sellers test

* Update README.md

* Add more keywords to collections, like 'product collection' to recommendation collections

* Rephrase the README note about Collections registration

* Simplify types

* Rename unchangeableFilters to hideControls

* Fix typo in file name

* Remove 'pattern' references from toolbar files

* Replace hardcoded SCSS color with wc variable

* Remove changelog file from different PR

* Move hideControls to Product Collection ayttributes

* Improve responsiveness of columns in Product Collection Placeholder

* Use admin color pallette in Product Collection Placeholder

* Move Inherit query from template to the top of Inspector Controls

* Change the Collection prefix to woocommerce rather than woocommerce-blocks

* Simplify Placeholder and Modal styles
2023-12-27 11:07:27 +01:00
Damián Suárez 300e79ac7f
[Product Block Editor]: fix feature flag to hide the Linked products (#43119)
* fix flag to hide/show product editor

* changelog
2023-12-26 14:14:43 -03:00
github-actions[bot] 0f880ff7a2
Delete changelog files based on PR 43074 (#43118)
Delete changelog files for 43074

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2023-12-26 22:44:02 +08:00
Luigi Teschio 7cb10704ff
fix: CYS - change heading color (#43076)
* fix: CYS - change heading color

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-12-26 09:07:52 -03:00
Tung Du c2cab76069
Fix: Collection data being leaked between Collection Filters blocks (#43044) 2023-12-26 16:13:30 +07:00
Damián Suárez 7be2481381
[Product Block Editor]: add Linked product sections. First approach. (#43013)
* add Linked products, Upsell section

* changelog

* add Cross-lens section

* add links to the Upsell sections

* changelog

* fix lint issues

* fix lint issus

* fix linting issue :-|

* check whether the linked product group is defined
2023-12-22 18:44:44 -03:00
Damián Suárez 7f2b1c42fd
Revert "Fix schedule sales error" (#43094)
Revert "Fix schedule sales error (#42700)"

This reverts commit 9b800aa179.
2023-12-22 18:20:56 -03:00
Luigi Teschio 99aeaff6dd
set WOOCOMMERCE_BLOCKS_PHASE to 1 for the production build (#43074)
* set WOOCOMMERCE_BLOCKS_PHASE to 1 for the production build

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-22 17:43:53 +01:00
Thomas Roberts db17f27f02
Load google analytics gtag script asynchronously in WooCommerce Blocks (#43040)
Co-authored-by: github-actions <github-actions@github.com>
2023-12-22 08:42:11 -08:00
Tung Du 0c5d01a6ac
Interactive Price Filter: use `context` instead of `state` (#42980)
* feat: use context instead of state

* fix: temporary move the context to inner element for diffing to work

* fix: update context before navigation for optimistic UI
2023-12-22 22:05:31 +07:00
github-actions[bot] d14be998f5
Delete changelog files based on PR 43051 (#43081)
Delete changelog files for 43051

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2023-12-22 13:10:20 +01:00
github-actions[bot] 3ff4385e69
Delete changelog files based on PR 43033 (#43079)
Delete changelog files for 43033

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2023-12-22 13:08:07 +01:00
github-actions[bot] 6790d2558e
Release: Remove 8.5 change files (#43022)
Delete changelog files from 8.5 release

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
Co-authored-by: Alex López <alex.lopez@automattic.com>
2023-12-22 09:52:00 +01:00
Albert Juhé Lluveras 2da7b73e76
Add Playwright tests for All Reviews, Reviews by Product and Reviews by Category blocks (#42903)
* Remove Reviews blocks Puppeteer tests

* Minor code cleanup

* Typos

* Create publishAndVisitPost() editor util

* Fix subcategories when importing products in Playwright and add reviews

* Add Reviews blocks tests in Playwright

* More typos

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

* Create a 'reviews' object in data.ts so we can store reviews data in one single place

* Update test so instead of creating a new post in each test, we go to the already-created post

* Add source comments to reviews data to match it with the script

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-22 09:33:18 +01:00
github-actions[bot] a355346be2
Prep trunk for 8.6 cycle (#43021)
Prep trunk for 8.6 cycle with version bump to 8.6.0-dev

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2023-12-22 09:27:54 +01:00
Kyle Nel 92e1b932c3
Change marketplace install API request to POST instead of GET (#43033)
* Change marketplace install API to using POST instead of GET
* Fix linting error
* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-22 10:03:11 +02:00
Néstor Soriano a8b0f88bad
Introduce the transient files engine (#42877)
Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
2023-12-22 08:44:18 +01:00
Sam Seay 3eeeddfdb3
[Experimental] Interactivity Dropdown multi-select mode, ratings filter and introduce each directive (#42981)
---------
Co-authored-by: David Arenas <david.arenas@automattic.com>
2023-12-22 13:34:28 +13:00
Maikel David Pérez Gómez a592a473d3
Introduce a product type selection within the new experience (#41823)
* Create a relation between the product type and the product block template

* Add 'patterns' to name the kind of products that can be created for a specific template

* Resolve template using its id as a template query param

* Rename ProductEditPattern to ProductTemplate

* Rename get_patterns hook to woocommerce_product_editor_get_product_templates

* Return the list of templates to the client

* Set layout template events as array

* Register the layout template based on the product template or the post type in case of product variations

* Registering non supported product types

* Create and register the woocommerce/product-details-section-description block

* Add the product type to the section description

* Create product type selector

* Fix menu item style

* Highlight selected menu item

* Set the selected product template

* Set product template title to lowercase in the content description

* Rename blocks by blockTemplates under the AbstractBlockTemplate class

* Rename to woocommerce_product_editor_product_templates filter

* Remove product_template_ prefix from the supported_product_types map

* Rename get_formatted to to_JSON and convert the props to client side like

* Refactor get_product_templates

* Fix icon resolution

* Add a confirmation modal for unsupported product templates

* Add changelog files

* Remove product types using for testing

* Fix redirection when changing to a non supported product template

* Set the change button state to busy when it is saving the product

* Fix php linter errors

* Fix rebase conflict

* Move ProductTemplate to Automattic\WooCommerce\Admin\Features\ProductBlockEditor namespace

* Add the to_json definition to the BlockTemplateInterface

* Create default product template by custom product type if it does not have a template associated yet

* Fix some comments and product template creation validation

* Add support to load the product template icon from an external resource

* Fix php linter

* Fix the changelog description
2023-12-21 18:45:31 -05:00
Damián Suárez eac1a460f0
[Product Block Editor]: Add `Linked product` tab (#43009)
* add linked-products to group IDs

* add Linked Products tab

* tweak hideConditions condition

* changelog

* fix typo in doc comment
2023-12-21 16:00:32 -03:00
Marc Guay 65828db266
Update class-wc-gateway-bacs.php (#43054)
* Update class-wc-gateway-bacs.php

Fix typo in textdomain

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-21 19:54:12 +01:00
louwie17 9182efaaf6
Fix product task redirect to support grouped and external products (#43051)
* Rearrange product redirection logic to better accept grouped and external produc types

* Add changelog
2023-12-21 14:09:00 -04:00
Jonathan Lane a67a1c6efc
Add github reporter (#42974)
* Add github reporter

* Add changelog

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2023-12-21 09:07:54 -08:00
Moon dc26c5a8f4
Fix incorrect wpBody margin top value set by TasksReminderBar (#43020)
* Use clientHeight to set the correct marginTop -- height is not a valid property

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-21 08:43:50 -08:00
Alba Rincón b3db937d3a
CYS - Ensure the offline modal is displayed whenever AI is unavailable (#42949)
* Show the ai offline modal independently from the onboarding tour

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

* Remove log

* Fix tests

* Add customizing parameter to avoid showing the aioffline modal when customizing

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-21 16:56:22 +01:00
Jaclyn Chen d1a8f91836
Analytics: add `date_type` parameter to override date type option for revenue stats (#42938)
* Add `date_type` parameter to revenue stats API for overriding the date type column.

* Update coding styles.

* Add changelog.

* Validate `date_type` value with strict matching.

* Add test cases for passing a valid/invalid `date_type` parameter.

* Remove extra validation on `date_type` value as it's already validated at the API level.

* Check for each allowed value of `date_type` in the test case.
2023-12-21 09:38:19 -04:00
Paulo Arromba 1219cadf10
Fix/ Count() warning/error on invalid data supplied by the filter `woocommerce_cart_shipping_packages` (#42964)
* Fixed count() warning on invalid data supplied by the filter.

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

* Removed unnecessary if

* Ordered comment to match if-clause
2023-12-21 13:24:39 +00:00
Fernando Marichal 9b800aa179
Fix schedule sales error (#42700)
* Fix schedule sales error

* Add changelog

* Fix lint

* Fix variable product error

* Add clear cache

* Remove sale price fix from data-store-cpt

* Fix comment

* Remove cache cleaning

* Add unit tests

* Fix lint

* Modify get_price
2023-12-21 10:10:22 -03:00
Thomas Shellberg cf52b42e26
Add React Testing Library to the Woo AI plugin. (#42993)
* Add React Testing Library and the simplest of tests to verify tests can be run successfully.
2023-12-21 12:25:08 +01:00
Niels Lange 01ede130aa
Adjust indents of old notice styles (#43031)
* Clean up old notice styles

* Adjust vertical marging for error list items on TT theme

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

* Delete obsolete CSS file

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-21 17:10:14 +07:00
Tom Cafferkey 505fe17db2
Product Hero Pattern: Fix button alignment (#42913)
Co-authored-by: github-actions <github-actions@github.com>
2023-12-21 09:31:23 +00:00
Tom Cafferkey a9550d8894
Store API: Add support to query product_variations by attributes (#42983)
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-12-21 08:09:06 +00:00
Tom Cafferkey 99fc85ae15
Block Hooks API: Add Tazza theme to the list of allowed themes for Mini Cart auto-insertion (#42900)
Co-authored-by: github-actions <github-actions@github.com>
2023-12-21 08:08:54 +00:00
Manish Menaria ba4f3d4d29
Add price range filter to Product Collection block (#42858)
* Add price range filter to Product Collection block

This update introduces a price range filter feature to Product Collection. Changes include:

1. Constants Update:
   - Added `priceRange` as undefined in `DEFAULT_QUERY` and `DEFAULT_FILTERS` in `constants.ts`.

2. Style Adjustments:
   - Added CSS for `.wc-block-product-price-range-control` in `editor.scss` to align the input text to the end.

3. Component Integration:
   - In `inspector-controls/index.tsx`, the `PriceRangeControl` component is now imported and integrated.

4. New Components:
   - `PriceTextField.tsx` and `PriceRangeControl/index.tsx` have been created to handle price range inputs in the Product Collection block.

5. Backend Integration:
   - `PriceRange` interface added in `types.ts` for type support.
   - In `ProductCollection.php`, a filter (`add_price_range_filter`) is added to modify the main query based on the price range, including adjustments for tax considerations.

Overall, this enhancement allows users to filter products within a specific price range. The backend adjustments ensure that the filtering respects tax settings and displays accurate prices.

* Fix formatting

* Fix: Price range filter not working on Editor

* Improve: Share logic between Frontend & Editor

* Add changelog

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

* Remove duplicate changelog file

* Enhanced Input Control for Price Fields

Key changes include:

1. **Switch to Input Control**: Replaced the NumberControl component with the more versatile InputControl. This offers better handling of currency formatting and user input.

2. **Currency Formatting Logic**: Added robust logic for formatting numbers according to the currency settings. This includes handling thousand separators, decimal places, and currency symbols.

3. **String-to-Number Conversion**: Implemented a function to convert user-entered strings back to numbers, accounting for currency symbols and separators. This ensures accurate parsing of user input for processing.

4. **Input Handling Improvements**: Modified the onChange handlers for minimum and maximum price inputs. Now, they correctly handle edge cases like undefined or zero values, maintaining consistency in the user interface and data processing.

* Refactor price range query handling

1. Introduction of a new method `get_price_range_query_args()` to encapsulate the logic for handling price range queries, especially for the two edge cases:
   - Prices excluding tax displayed including tax.
   - Prices including tax displayed excluding tax.

2. Removal of direct conditionals in the `get_query_results()` method, replacing them with a call to the new `get_price_range_query_args()` method. This makes the code more modular and easier to understand.

This refactor enhances readability and maintainability of the code, ensuring that special cases in price range filtering are handled more effectively.

* Remove unnecessary suffix prop

* Refactor PriceTextField formatting logic for currency

1. Conditional application of thousand separators: The code now checks for the existence of `currency.thousandSeparator` before applying it. This prevents potential errors when the separator is undefined.

2. Simplified decimal separator handling: Introduced a fallback for the decimal separator, defaulting to a period ('.') if not specified by the currency settings.

3. Enhanced readability and documentation: Added comments to clarify the purpose of code blocks, especially where currency symbols are added or removed, and where value normalization occurs.

4. Function renaming for clarity: Renamed `formatValueWithCurrencySymbol` to `formatCurrency`, which better reflects its purpose.

* Fix onBlur issue with PriceTextField component

Refactored the PriceTextField component to utilize useState for better state management. This change introduces a local state variable, 'newValue', to store the current value. The state updates occur in the handleOnChange function, ensuring that the component's state is managed efficiently. Additionally, a new function, handleOnBlur, is implemented to handle the onBlur event, updating the component's state when focus is lost. The handleEnterKeyPress function captures the 'Enter' key press, providing a more user-friendly experience by allowing users to confirm their input with the Enter key.

* Fix linting error

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-21 12:45:20 +05:30
Niels Lange 49d6b2058a
Link cross-sells product image to product page (#42904)
* Link cross-sells product image to product page

* Add changelog entry

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-12-21 11:13:47 +07:00
Justin Palmer cb0c42180a
Revise excluded order statuses for order attribution customer history (#42999)
* Better align excluded order statuses with WC Reports

* Update Tracks data to match updated customer order history count

* Add changelog

* Clarify code comment

* Exclude `checkout-draft` for block checkout/API orders.

* Remove unecessary array_map

Co-authored-by: Bartosz Budzanowski <bartosz.budzanowski@automattic.com>

* Use existing method to get un-prefixed order statuses

---------

Co-authored-by: Bartosz Budzanowski <bartosz.budzanowski@automattic.com>
2023-12-21 00:06:30 +01:00
Simran Vijwani 8e351f2f15
Add UTM group to product URL on the Discover page (#41967)
* Add utm_category to discover page

* Fix product category URL params

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

* Update productCategory to productGroup in Discover and NoResults components

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

---------

Co-authored-by: Simran <simran.kaur@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2023-12-21 02:13:52 +04:00
Dekadinious d8e01b23cd
Update documentation in class-wc-order-item-product.php (#41160)
* Update class-wc-order-item-product.php

* Changelog.

* Fix alignment.

---------

Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
2023-12-20 13:52:00 -08:00
Leif Singer 06dc19ebd4
Ensure the gateway activation email does not depend on the gateway title being stored in the settings option (#42992)
* use `method_title` for the email to the admin as that is better suited for an admin context

* do not require the title to be set in the updated option

* add the changelog file

* adjust the test, too

* appease the linter
2023-12-20 13:44:30 -08:00
Ilyas Foo 4a5373409b
Fix shipping cost formatting to respect shipping formula (#42916) 2023-12-21 10:25:43 +13:00
Kathy 4d7bf10c96
Use product-sale-price ID for hooks. Closes #42907. (#42908)
* Use product-sale-price ID for hooks. Closes #42907.

* attempt to add a changelog
2023-12-20 17:44:32 -03:00
Damián Suárez e1e1d3c593
[Product Block Editor]: add `product-linked` feature flag (#43006)
* Add product-linked feature flag

* cchangelog

* enable product-linked flag in dev for now

* set product-linked unavailable in prod
2023-12-20 16:41:00 -03:00
Daniel Dudzic 7122669d44
Product Gallery: Simplify the Product Gallery Pop-up (#42797)
* Product Gallery Pop-up: Simplify the pop-up for v1

* Product Gallery Pop-up: Update the Product Gallery template part contents

* Product Gallery Pop-up: Add changelog entry

* Product Gallery: Fix CSS linting errors

* Product Gallery Pop-up: Add an additional changelog entry

* Product Gallery Pop-up: Update changelog message

* Product Gallery Pop-up: Fix logic error
2023-12-20 19:03:01 +01:00