* Make attributes available in rest_product_query hook
This commit introduces the 'includeInQueryContext' attribute to the 'woocommerce/product-collection' block and updates the 'woocommerce/product-template' block to consume this new attribute.
Key Changes:
1. `woocommerce/product-collection` Block:
- A new attribute 'includeInQueryContext' is added in `block.json`. This attribute is designed to hold a list of attribute names relevant for the query context.
- The 'includeInQueryContext' attribute is included in the `providesContext` field to ensure its availability to child blocks.
- In `constants.ts`, default values for 'includeInQueryContext' are defined, specifying 'collection' and 'id' as initial attributes.
- The `types.ts` file is updated with a comment explaining the purpose of 'includeInQueryContext'.
2. `woocommerce/product-template` Block:
- Modified `block.json` to utilize the 'includeInQueryContext' context provided by the parent `woocommerce/product-collection` block.
- The `edit.tsx` file is updated to handle the new context. It uses a newly added utility function `useProductCollectionBlockAttributes` from `utils.tsx` to access parent block attributes.
- The `utils.tsx` file is introduced, containing the `useProductCollectionBlockAttributes` hook. This hook is responsible for finding the parent 'woocommerce/product-collection' block and returning its attributes.
- Within `edit.tsx`, logic is added to create a query context object based on the attributes specified in 'includeInQueryContext', enhancing the block's ability to dynamically adapt to changes.
* Remove commented code
* Rename query context attribute and optimize parent block detection
This commit introduces two significant changes aimed at improving code readability and efficiency.
1. **Renaming of Query Context Attribute:**
- The attribute `includeInQueryContext` has been renamed to `queryContextIncludes` across various files, including block JSON configurations and TypeScript definitions. This change makes the attribute's purpose more intuitive, indicating it specifies which attributes to include in the query context.
2. **Optimized Parent Block Detection:**
- Replaced the use of `getBlockParents` with `getBlockParentsByBlockName` in utility functions to find the closest Product Collection block. This optimization allows for a more direct and efficient way to identify the relevant parent block by specifying the block name, reducing unnecessary iterations and improving code performance.
* Streamline query context construction in product template
Key Changes:
- **Introduction of `useProductCollectionQueryContext` Hook:** This new hook takes the `clientId` and `queryContextIncludes` as inputs and returns a query context object. It encapsulates the logic for fetching parent product collection block attributes and constructing the query context accordingly. This abstraction simplifies the edit component's logic, focusing on the essentials and improving code readability.
- **Optimization of Parent Block Detection:** The hook uses `getBlockParentsByBlockName` to accurately and efficiently find the closest parent `Product Collection` block, minimizing the overhead previously associated with traversing the block hierarchy.
* Always include `collection` and `id` in query context
* Minor refactor
* Enhance query context handling for more maintainable code
- Introduced `DEFAULT_QUERY_CONTEXT_ATTRIBUTES` in `edit.tsx` to maintain a clear list of default query context attributes.
- Modified `ProductTemplateEdit` to automatically include these default attributes in `queryContextIncludes`, ensuring they are always part of the query context without manual initialization.
- Simplified `useProductCollectionQueryContext` in `utils.tsx` by removing static initialization of 'collection' and 'id', relying instead on the dynamic addition of necessary attributes from `queryContextIncludes`.
This refactor enhances the maintainability and clarity of the code, ensuring a solid foundation for future enhancements and features.
* Add E2E tests for Product Collection query context
- Added a new test suite 'Query Context in Editor' to validate the correctness of query context parameters when the Product Collection block is used. This suite ensures that:
- For the 'Product Catalog', only the ID is sent in the query context, confirming that collection-specific parameters are excluded when not relevant.
- For collections such as 'On Sale', the collection name is correctly passed in the query context, validating that the block dynamically adjusts query parameters based on its settings.
- Introduced a new utility method `setupAndFetchQueryContextURL` in `product-collection.page.ts`. This method automates the setup of a post with the Product Collection block and fetches the URL with query context parameters, facilitating the validation of query context handling.
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Fix edge case when `queryContextIncludes` is not defined
- Initializing `queryContextIncludes` with a default empty array directly in the destructuring assignment of the component's props. This approach ensures that `queryContextIncludes` is always an array, simplifying downstream logic.
- Creating a new constant `queryContextIncludesWithDefaults` to hold the combination of `queryContextIncludes` and `DEFAULT_QUERY_CONTEXT_ATTRIBUTES`. This step avoids directly mutating the `queryContextIncludes` prop, aligning with best practices for functional purity and making the code easier to understand and debug.
- Updating the `useProductCollectionQueryContext` hook call to use `queryContextIncludesWithDefaults`. This ensures that the default query context attributes are consistently included without altering the original prop.
These adjustments not only enhance the code's maintainability but also ensure more predictable behavior by avoiding side effects related to parameter mutation.
---------
Co-authored-by: github-actions <github-actions@github.com>
* Remove global pageObject action from Product Collection tests and add it as before all for specific tests
* Replace beforeAll with beforeEach
* Adjust the beforeEach usage
* Add changelog
* Refresh locators when adding Single Product block as it's not initialised in pageObject
* Change method dedicated to templates to one dedicated to posts
* Remove 'get_block_template' backwards compatibility check
* Add back get_block_template as a deprecated function
* Deprecate BlockTemplateUtils::filter_block_templates_by_feature_flag()
* Replace 'default template' with 'fallback template'
* Only load BlockTemplatesController in block themes
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Remove unnecessary WP version comparison
* Revert "Only load BlockTemplatesController in block themes"
This reverts commit 8e1ed347d61b7ae5e8b8b96fa73b410565570f01.
* Remove deprecated functions, as they are marked as internal
---------
Co-authored-by: github-actions <github-actions@github.com>
* Remove WooCommerce Blocks entry from the WooCommerce status page
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add logic to trap keyboard focus inside the Product Gallery Pop-Up
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Remove unnecessary condition
* Fix issue with keyboard focus trap not working within the Pop-Up
---------
Co-authored-by: github-actions <github-actions@github.com>
* Update product-review
Add test to edit a product review and another test to delete it
* Add changefile(s) from automation for the following project(s): woocommerce
* Add changefile(s) from automation for the following project(s): woocommerce
* Added test data in fixture and changelog extra line
Change test data use from constants at the top to test data created in a fixture for each test. Also, added extra line to the changelog file.
* Add changefile(s) from automation for the following project(s): woocommerce
* Update changelog
Fixed mixed lines on previous commit.
* Add changefile(s) from automation for the following project(s): woocommerce
* Update plugins/woocommerce/tests/e2e-pw/tests/merchant/product-reviews.spec.js
Remove edited timestamp
Co-authored-by: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
* Update plugins/woocommerce/tests/e2e-pw/tests/merchant/product-reviews.spec.js
Update hover action to review id.
Co-authored-by: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
* Update plugins/woocommerce/tests/e2e-pw/tests/merchant/product-reviews.spec.js
Change Quick Edit button to reach review identifier
Co-authored-by: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
* Update plugins/woocommerce/tests/e2e-pw/tests/merchant/product-reviews.spec.js
Replace updated review check to single line assert
Co-authored-by: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
* Update plugins/woocommerce/tests/e2e-pw/tests/merchant/product-reviews.spec.js
Hover to edit on review identifier
Co-authored-by: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
* Update plugins/woocommerce/tests/e2e-pw/tests/merchant/product-reviews.spec.js
Point to trash a review to its identifier.
Co-authored-by: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
* Update plugins/woocommerce/tests/e2e-pw/tests/merchant/product-reviews.spec.js
Point to trash a review to its identifier.
Co-authored-by: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
* Added Review Edit test
Added Review Edit test apart from Quick Edit test. Included assertions to verify that the review has been edited and can be seen both in the reviews list and the shop's page.
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
* Improve password-protected Single Product block template to verify correct template is displayed after correct password is introduced
* Add changelog entry
* Import editor.scss styles of Product Templayte and increase specificity
* Add changelog
* Add ts ignore
* Revert changing eslint-disable as it conficts with another rule creating more errors
* Added Missing LInting Changes
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Jon Lane <jon.lane@automattic.com>
* Build path directly instead of directly loading REST API.
* Add changelog.
* Make shapes of routes array consistent with whats returned in API.
* Add doc comment.
* Fix missing slash typo
* Make linter happy.
* Add doc block for filter.
* Short hydration logic to use controller directly.
* Rename _get_path to get_path_regex for accuracy and lint.
* Restore nonce check bypass for internal hydration requests.
* Restore cache notice check to allow controllers to start from clean slate.
* Update since tag.
* CYS - Core: ensure that the default font and color are selected
* remove console.log
* Add changefile(s) from automation for the following project(s): woocommerce
* add comment
* add changelog
---------
Co-authored-by: github-actions <github-actions@github.com>
* Fix fonts affecting the size of each other
* Add changefile(s) from automation for the following project(s): woocommerce
* Remove log
* Removae old typography settings before applying new ones
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add automated tests to verify specific product templates are rendered
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
---------
Co-authored-by: github-actions <github-actions@github.com>
* Include collection attribute in the block context
* add 'collection' to useContext for Product Template
* Changelog
---------
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
* Add tests skeleton
* Add up-sell test
* Add changelog
* Add test for cross-sells
* Renamed spec file
* Add tests for remove up-sells and remove cross-sells
* Update the viewport
* Extract the update product action into a function
* Fix the expect for up-sells
* Add a poll mechanism when checking that up-sells were removed.
* * Use backspace to remove linked items
* Add a check for up-sells before removing them to prevent a false negative result
* Uncomment cleanup code
* Revert viewport height
* Return focus to trigger element when closing pop-up
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Fix php cs error
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add new test with a product name edit
* Add changelog
* Update price and description
* Check product summary update
* Remove unnecessary interpolation
Previously, a 'coupon_data' line item meta entru was being stored
when a coupon was applied to an order. Now a much shorter
'coupon_reapply_info' entry is stored instead, containing just
coupon id, code, discount type, amount, and whether the coupon
grants free shipping.
* Improve Product Collection test when nested in Single Product block, previous version was flakyu
* Add changelog
* Move the priovate method below the comment starting private methods
* Remove unnecessary wait
* Update data store to bail if there is no customer ID
* Use WC_Data meta functions
* Save and load meta in session class
* Customer session handling
* CheckoutFields - only persist customer data to accounts
* Inline docs for session handling
* Handle meta data in session
* Document wc->customer inline
* Store only additional fields in session
* Prevent notice in WC_Data
* Organise keys and remove duplicates
* Correctly save fields to account
* Fix notices on checkout
* Remove unnecessary diff
* Changelog
* Go back to previous way to loading session handler to avoid 3rd party breakage
* No need to track is_session
* white space
* Remove changes to customer data store
* Update class-wc-customer-data-store.php
* Populate client from additional values from api
* Additional fields in session
* Add woocommerce_customer_allowed_session_meta_keys hook
* Put back legacy keys for tests
* Remove key fixes
* Don't save additional fields to customer object
* Remove duplicate init call
* Only persist contact fields
* Add back parent machine to the designWithoutAi child machine option
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Simplify add template title and description
* Add template title and description on 'get_block_template' hook. Fixes#42221
* Add tests
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Fix test in template parts
* Use BlockTemplateUtils::template_has_title when possible
* Add test also when saving the default WooCommerce template
---------
Co-authored-by: github-actions <github-actions@github.com>
* 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>
* 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>
* Updated Lock File
* Add changefile(s) from automation for the following project(s): woo-ai
---------
Co-authored-by: github-actions <github-actions@github.com>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* use text-area for variation desctiption field
* changelog
* tweak // Translators string
* use var to define textarea border color
* remove optional from description label
* 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>
* 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>
* 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>
* 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
* 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
* 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>
* 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>
* 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
* 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
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>