Commit Graph

19759 Commits

Author SHA1 Message Date
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