* Remove experimental flags
* changelog
* Check theme is block theme
* adjust test since this setting is only visible with block themes
* Hide dark mode option if password input is disabled
* Remove clear button when setting is disabled
* Add clear button when setting is enabled
* Move logic to a React hook
* Fix error preventing clear button from being inserted after full page reload
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Add e2e test
* Fix ancestor
* Fix clear button settings for the Status filter
* Move hook to the root Product Filters folder
* refactor: divide the logic into multiple functions
* refactor: move util functions to their own files
* feat: add clear button hook to all individual filters
* test: add e2e test to the Product Filter Price block
* fix: block being created with the wrong default attributes
* fix: eslint errors
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add To Cart With Options - Stepper layout: implement feature under feature flag
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce, woocommerce/client/admin
* fix E2E tests
* fix E2E test
* fix E2E test
* use setFeatureFlag across e2e test suite
* use the right feature flag
---------
Co-authored-by: github-actions <github-actions@github.com>
* Remove inspector notice
* Replace placeholder with generic version
* Implement new placeholder
* Fix shipping method count so it excludes rows which do not link to installed payment method
* changelog
* Set default so tests pass
* unused vars
* unused import
* Remove return type and fix import warnings
* add color block attributes
* add constant to define the color attributes
* centralize Color type
* define color types
* use UpperCase for Edit component
* render colors panel. save color values in attrs
* add a doc about colors validation
* save CSS vars and classes in the block markup
* pick and apply colors to the styles
* update markup with block colors
* firx eslint issue
* changelog
* reset all colors properly
* 80 cols
* set Color type peroperties like optional
* apply color to slider background
* Add to Cart Form: Ensure Compliance with min, max, and step HTML Attributes
* add comment
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* improve fallback value
* remove only
* add aria-label
* remove extra space
* Update plugins/woocommerce/changelog/52487-fix-add-to-cart-form-interactivity-api
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* improve variable naming
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Merge branch 'trunk' of github.com:woocommerce/woocommerce into fix/add-to-cart-form-interactivity-api
* improve code style
* improve E2E tests
* improve fallback value
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Add To Cart Form - Stepper Layout: remove flex
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
---------
Co-authored-by: github-actions <github-actions@github.com>
* Fix: Product collection inspector control showing empty section
Previously, the inspector controls were always rendering a PanelBody element even
when the collection type wasn't hand-picked, resulting in an empty section being
displayed. This change moves the PanelBody inside the conditional rendering so
it only appears when hand-picked products are being used.
Also adds missing placeholder text to the Hand-Picked products control to improve
user experience.
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
---------
Co-authored-by: github-actions <github-actions@github.com>
* Hide product grid blocks from inserter
* Expose collections in the inserter
* Arrange collections imports alphabetically and registering by usage
* Add new keywords to collections
* Update tests
* Update block references
* Add changelog
* Update docs manifest
* Fix typo in collection name in test
* MAke adjsutments and cleanup of collections keywords
* Add one more keyword
* Hide Related Products from inserter
* Replace legacy Related Products with collection when transforming classic template into block one
* Replace legacy Related Products with collection in blockified Single Product Template
* Update block references and doc manifest
* Update block references
* Update tests to reflect new collection names
* Bring back pnpm-lock to original state
* Update Related Products E2E tests
* Fix the last Related Products test
* Add default queryId to Related Products pattern
* Regenerate block references and docs manifest
* Update product filters active block to new structure
* Build active chips items
* Add changelog
* Remove unneeded line-height
* Fix linting
* Fix e2e tests
* Refactor removeText
* Clean up
* Add clear button even without group
* Fix stock status name in e2e test
* Remove heading block
* Remove unused i18n module
* Remove period
* Add clear button variation description
* Fix typo
* Rename active chips to removable chips
* Extract data items from removable chips to make it reusable
* Fix e2e tests
* Add frontend script loading to null
* Don't render the block if no active filters
* Disable clear button by default
* Clean up
* Hide with iAPI
* Fix linting and e2e
* fix: add hidden tag serverside
---------
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Product Collection: Add "Rating, low to high" and "Rating, high to low" sorting options
This commit adds a new sorting option to the Product Collection block that allows
sorting products by rating from low to high. The existing "Top Rated" option has
also been renamed to "Rating, high to low" for consistency.
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
---------
Co-authored-by: github-actions <github-actions@github.com>
* introduce file to define collection data types
* do not define `results` always like an array
* update passing types to useCollection intances
* allow to set the useCollectionData response type
* reuse RatingValues type
* tidy collection types in status filter
* clean types defined in type-defs pck
* change changelog type
* update attribute filter
* move Collection Data types to product-collection folder
* update WCStoreV1ProductsCollectionProps path
* improve defining the results type for the collection
* update path to import product collection types
* fix path to import RatingValues type
* Add random sorting option to Product Collection block
This commit introduces a new 'Random' sorting option to the Product Collection block. The changes include:
1. Adding a new option for random sorting in the frontend UI (order-by-control.tsx).
2. Updating the backend to support the new random sorting option (ProductCollection.php).
These changes allow users to display products in a random order, enhancing the flexibility of product presentations in WooCommerce stores.
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Add PHP unit tests for random sorting option
* Remove "asc" suffix from random sorting option
The "asc/desc" order is not needed for random sorting. This commit:
- Changes `random/asc` to just `random` in sorting options
- Updates code to handle sorting options without order suffix
- Adds fallback to 'asc' order when no order is specified
* Fix: "order" shouldn't be present in REST API params
---------
Co-authored-by: github-actions <github-actions@github.com>
* Create loading state for payment methods on block checkout
* Tidy and type fix checkPaymentMethodsCanPay
* Disable place order button before payments are Initialized
* Toggle and loading state
* changelog
* Reduce scope of change in check payment methods
* saved methods are hidden when empty
* update Rating experimental filter title
* allow to insert the filter block
* fix ancestor block name
* remove showFilterButton from attribute types
* udpate icon
* add rating to the initial filters template
* clean rating filter utils
* minor styling code enhancement
* tidy
* remove isEditor const
* import type explicitely
* rename block to CheckboxListEdit
* set defautl style for Rating block
* rename block to RatingFilterEdit
* undestructuring attributes object
* compose rating block by using template
* use InitialDisabled instead of Disabled
* set block instance name
* set display style properly
* do not rename checkbox list block instance
* passing context to CheckboxList block, server-side
* import type explicitely
* process rating data in server-side
* handle activate/deactivate rating filters
* support clean rating filters in the frontend
* remove temporarely action to handle dropdown
* changelog
* remove Dropdown mode for now
* use custom Notice component
* do not import unused libs
* rename method to get_rating_items
* declar selected_ratings_query as mixed
* sort rating stars by value descending
* udpate changelog message
* linting
* remove unused vars
* set selected_ratings_query like an array
* set get_rating_items $select param as an array
* set explicitely Attributes type
* remove unneeded InitialDisabled component
* remove useSetWraperVisibility hook usage
* sort rating straight via SQL
props to @dinhtungdu https://github.com/woocommerce/woocommerce/pull/52152/files#r1818839577
* remove local state to show no products notice
* Add "Products" suffix to some collections name as they're being exposed in the inserter and had confusing names without Product Collection context
* Add changelog
* Update E2E tests
* Add order reference to Upsells and Cross-sells
- Added 'order' to usesReference in cross-sells and upsells
- Updated LinkedProductControl for order context
- Enhanced ProductCollection to handle order references
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Add PHP code for Cross-sells collection
* Fix formatting
* Add E2E tests
1. In the Cart Template, it checks that "From products in the cart" is
selected by default for the "My Custom Collection - Cart Context".
2. In the Order Confirmation Template, it verifies that "From products
in the order" is chosen by default for the "My Custom Collection -
Order Context".
* Add 'block' scope to cross-sells collection
* Extract and use reference type constants
This commit extracts the REFERENCE_TYPE_CART and REFERENCE_TYPE_ORDER
constants to the top of the file and updates their usage throughout
the code, including in the getFromCurrentProductRadioLabel function.
* Align variable naming for product references in Product Collection
This commit updates the ProductCollection class to ensure consistency in
variable naming for product references across different collection types,
particularly aligning with the naming convention used in Upsells.
* Add "hadOrderReference" to conditional label display
Key changes:
- Removed `isUsesReferenceIncludesCart` parameter from `getFromCurrentProductRadioLabel`
- Introduced `hasCartReference` and `hasOrderReference` parameters for consistency
- Updated conditional logic to check for both cart and order references
- Adjusted the function call in `LinkedProductControl` to pass both new parameters
* Fallback to 0 for orderId in get_product_ids_from_order calls
---------
Co-authored-by: github-actions <github-actions@github.com>
* Rename Stock Status Filter to Status Filter
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Fix e2e test error
* fix php lint error
* Fix php lint errors
* fix php lint errors
* Update variable name to match the new block name
* Update block name
* Rename variables to match new block name
* fix import error
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add "Manual (menu order)" sorting option to Product Collection block
This change allows store owners to use their custom product order
(set in the WooCommerce admin panel) within the Product Collection block,
providing more flexibility in product listing.
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Change order from DESC to ASC
* Add test for menu_order sorting in ProductCollection
This commit adds a new test case to verify the functionality of menu_order
sorting in the ProductCollection block. The test ensures that when the
'orderBy' attribute is set to 'menu_order' and the 'order' is set to 'asc',
the resulting merged query correctly includes these sorting parameters.
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add 'all products' keyword to Product Collection
* Hide All Products from inserter
* Add changelog
* Update test
* Update E2E tests
* Update E2E
* Fix the test by replacing All products with Product Collection
* Fix: Upsells collection not showing correct products on frontend
This commit addresses an issue where the Upsells collection wasn't displaying the correct products on the frontend. The problem was caused by a variable name mismatch in the condition checking for empty product references.
* Add changefile(s) from automation for the following project(s): woocommerce
* Rename product_references variable for consistency
* Add support for linked products in cart context
This commit extends the LinkedProductControl component to support
linked products in the cart context. It introduces the following changes:
- Add a check for cart location alongside product location
- Introduce a dynamic label for the radio control option, which changes
based on whether the context is a product or cart
- Refactor the logic to determine when to show the radio control and
which option should be selected by default
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Refactor LinkedProductControl for improved clarity and flexibility
- Extract getFromCurrentProductRadioLabel function for better reusability
- Improve conditional logic for showing linked product control
- Enhance readability by using more descriptive variable names
- Simplify showLinkedProductControl calculation
* Refactor: Add constants for reference types in LinkedProductControl
* Rename variables in LinkedProductControl for clarity
- 'isUsesReferenceIncludesProduct' to 'hasProductReference'
- 'isUsesReferenceIncludesCart' to 'hasCartReference'
* Remove unused import
* Revert changes in ProductCollection.php
---------
Co-authored-by: github-actions <github-actions@github.com>
* fix Add To Cart form layout on post editor
* improve code
* fix conflict after merge
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
---------
Co-authored-by: github-actions <github-actions@github.com>
* Filter product collection variations by 'block' scope
This commit updates the product collection feature to only show variations
with the 'block' scope in the collection chooser. To achieve this:
1. Added 'block' to the scope array for various product collection variations
(best-sellers, featured, hand-picked, new arrivals, on-sale, related,
top-rated, and upsells).
2. Modified the collection chooser logic to filter variations based on the
'block' scope.
* Product Collection: Hide collection chooser toolbar for non-block scoped collections
This commit modifies the ToolbarControls component in the Product Collection block to conditionally render the CollectionChooserToolbar. The toolbar is now only displayed for collections with a scope that includes 'block'.
* Add scope property to product collections in E2E tests
This commit adds the 'scope' property to all registered product collections
in the E2E test plugin. The 'scope' is set to ['block'] for each collection.
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Rename isShowCollectionChooserToolbar to showCollectionChooserToolbar
for better readability.
* Add documentation and refactor for product collection scope
This commit introduces the following changes:
1. Update documentation to explain the `scope` argument for product collections
2. Refactor Collection Chooser and toolbar controls to handle default scope
3. Remove explicit `scope` from test collections to align with default behavior
* Add E2E tests for Product Collection scope argument
This commit adds E2E tests to verify the behavior of Product Collections
registered with different scopes. It includes:
- Tests for collections with 'inserter' and 'block' scopes
- Verification of visibility in Collection Chooser
- Checks for 'Choose collection' button visibility
* Generate manifest file
* Generate manifest file
* docs: Remove unsupported emojis from product collection documentation
---------
Co-authored-by: github-actions <github-actions@github.com>
* Hide preview label when a specific product is selected
This commit modifies the Product Collection block to hide the preview
label when a specific product is selected by the user. It addresses the
issue where the preview label was still showing even when a product
reference was available.
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
---------
Co-authored-by: github-actions <github-actions@github.com>