* 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>
* Use WP 6.7 RC2 for Blocks env
* Update edited template heading selector
* Change selector in revertTemplate util due to issue in GB (WP 6.7)
* Update edited template heading selector in another suite
* Use page instead of editor.canvas to access components-popover
* Add changelog
* Update editor heading selector
* Update editor heading selector
* Fetch order snapshot for HPOS
* Fetch order snapshot for legacy order storage
* Include snapshot generation time
* Add changefile(s) from automation for the following project(s): woocommerce
* Fix linter error
* Add unit test for order snapshot data
* Add unit test for snapshot generation time
* Fix phpcs error
---------
Co-authored-by: github-actions <github-actions@github.com>
* Optimize Coming Soon badge performance with early exits
Improves performance by preventing unnecessary code execution for non-admin users:
- Add early exit in setup_hooks() for non-admin users
- Move hook registration to init to ensure WordPress is loaded
- Prevent badge-related actions from being registered for non-privileged users
This change reduces unnecessary code execution and improves overall
performance by isolating the Coming Soon badge functionality to only
run for authenticated admin users.
* Add changelog
* Fix permission check
* Introducing order status constants
* Replacing static calls
* Additional comment blocks
* Updating PHP docs
* Updating PHP docs
* Add changefile(s) from automation for the following project(s): woocommerce
* Fix lint issues
* Fix lint issues
* Fix lint issues
* Removing unnecessary order statuses group constants + more documentation
* Including the 'new' status (legacy)
* Merge branch 'dev/introducing-order-status-constants' of https://github.com/woocommerce/woocommerce into dev/introducing-order-status-constants
* Moving statuses to a new enum class
* Fix CS issues
* Fix lint issues
* Minor doc improvement
* Changing namespace to make it less granular
* Adding missing documentation for existing filters
* Update plugins/woocommerce/src/Enums/OrderStatus.php
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
* Update plugins/woocommerce/includes/class-wc-order.php
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
* Update plugins/woocommerce/src/Enums/OrderStatus.php
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
* Making the order status class final
* Adding missing filter comments
* Moving conditional filter back to if statement
* Merge branch 'dev/introducing-order-status-constants' of https://github.com/woocommerce/woocommerce into dev/introducing-order-status-constants
* Adding 'since' annotation to fix lint errors
* Adding 'since' annotation to fix lint errors
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
Co-authored-by: Vladimir Reznichenko <kalessil@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
* Move email preview rendering into separate class
* Allow setting WC_Email $object
This is needed so in an email preview, we can set order to be rendered in an email
* Render "Processing order" with dummy order in email preview
* Always show shipping address in email preview
* Allow fetching dummy email preview product
* Add changelog
* Add unit test for EmailPreview
* Clean up filters after rendering email preview
* Improve duplicate filter comment
* Replace __return_true with a function to prevent accidental filter removal
* Avoiding shipping calculator prop drilling with context
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* useCallback for update functions
---------
Co-authored-by: github-actions <github-actions@github.com>
* Fix Product Collection rendering inside Single Product block
This commit addresses issue #51352 where the Product Collection block
inside a Single Product block was not rendering correctly on the frontend.
Specifically, the first product in the collection was being replaced by
the product selected in the parent Single Product block.
* Add changefile(s) from automation for the following project(s): woocommerce
* Fix issue for core/post-template block too
---------
Co-authored-by: github-actions <github-actions@github.com>
* 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>
* Removed Los Angeles local pickup option from mock data.
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Updated js test
* Reverted js test
* Updated mockup pickup locations
* Updated mockup pickup locations
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
---------
Co-authored-by: github-actions <github-actions@github.com>
* Check for valid session object before calling get_customer_id in Cart Route
* Add changefile(s) from automation for the following project(s): woocommerce
* Harden get_cart_token function to make sure the cart is loaded before we access the session
---------
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
* Add new /orders/{id}/details endpoint first version
* Add tests for the OrderDetailsRestController
* Fix lint errors and service provider
* Add changefile(s) from automation for the following project(s): woocommerce
* Update note to mention it was created via a REST API request
* Document the original actions and reference them from the endpoint
* Refactor the endpoint to be `/actions`
* Add changefile(s) from automation for the following project(s): woocommerce
* Add back loading payment gateway and shipping classes
* Refactor endpoint to be `actions/send_order_details`
* Address feedback: improve error message and note
---------
Co-authored-by: github-actions <github-actions@github.com>
* 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 Kliken Meta Ads & Pixel in core profiler recommendation 50% in place of pinterest
* Lint
* Changelog
* Fix using the correct pinterest object
* Lint
* Test that sku skipping works
#46505
* Switch SKU and ID error detection
If we find an product with the same SKU we overwrite the imported product id with the existing one. When we check for the existing ID first, we would get now a match although the imported ID did not match. Therefore we first check if the SKU is already present before checking for the ID
#46505
* Add doc
* Add changelog
* Add changefile(s) from automation for the following project(s): woocommerce
* Remove unneeded changelog entry pulled in during rebase.
* Remove mistakenly pushed debug code.
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
This works fine:
```
curl -u bor0:asdf -X OPTIONS "localhost:8080/wp-json/wc/store/v1/products?_unstable_tax_asdf_operator=1" | jq
```
However, this causes a fatal error `PHP Fatal error: Uncaught TypeError: str_starts_with(): Argument #1 ($haystack) must be of type string, int given`:
```
curl -u bor0:asdf -X OPTIONS "localhost:8080/wp-json/wc/store/v1/products?1=2" | jq
```
* Add global_unique_id to importer controller
* Add changelog for gtin import mapper
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* init
* comment tweak
* changelog
* use gihub recommended method
* removed content write permission
* change in how to extract PR number
* change in how to extract PR number
* change in how to extract PR number
* regex change
* regex change
* template updates
* updated comments
* set global permission to empty and moved it within each job
* refactored code, created a needs step
* add condition to prep
* added acknowdegement section
* added github comment
* Moved variables to env
* PRR template
* PRR template changes
* Added changes to cfe notifications
* minor changes
* Added slack message sanitization
* PRR cherry-pick flow
* add cherry pick to frozen release label
* bug fix
* use js instead of shell
* use js instead of shell
* template updates
* frozen release as output
* added some comments
* pr base change
* pr base change
* descp change
* copy changes
* Added checkboxes conformation
* added ack section
* fixed bug
* fixed bug
* fixed bug
* typo
* bug fix
* bug fix
* added logic for github comment
* bug fix
* GH PR comment
* GH PR comment for CFE flow
* GH PR comment for CFE flow
* changelog
* In complechangelog step - extract version from branch
* add validation for manual version input
* log the version user entered
* log the version user entered
* rebased changes
* Code refactor
* bug fixes and formatting
* code refactor
* bug fixes
* template updates and using context object instead of parsing
* bug fixes
* renamed file
* moved vars to env
* Init
* comment tweak
* changelog
* use gihub recommended method
* removed content write permission
* change in how to extract PR number
* regex change
* template updates
* updated comments
* set global permission to empty and moved it within each job
* refactored code, created a needs step
* add condition to prep
* added acknowdegement section
* added github comment
* Moved variables to env
* review changes
* 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
* Refactor coming soon banner styles and enqueueing
This commit refactors the styles for the coming soon banner in the WooCommerce plugin. The changes include:
- Moving the styles from the `woocommerce.scss` file to a new `coming-soon.scss` file.
- Updating the styles for the `#coming-soon-footer-banner` element.
- Adding a new class `.coming-soon-footer-banner__content` for the content inside the banner.
- Updating the styles for the dismiss button.
Additionally, the commit modifies the `ComingSoonRequestHandler.php` file to enqueue the new `coming-soon.css` file when the coming soon feature is enabled.
These changes improve the organization and maintainability of the code related to the coming soon banner and ensure that the correct styles are applied.
* Add changelog
* Fix styles
* Remove empty line
* Update check orders
* 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 delayed account creation to WC_Tracker snapshot
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Use method title or gateway title in Checkout compatiblity notice
* use better conditions
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* feat: add support for SalePrice in JSON-LD schema for structured data
* Add changefile(s) from automation for the following project(s): woocommerce
* fix: phpcs issues
* feat: add SalePrice property to variable products on sale
* feat: use sale end date of lowest-priced variation for validThrough in schema
* refactor: simplify code
* fix: ensure that only sale prices are considered for the SalePrice property in variable products on sale
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add To Cart Form: hide stepper when product is sold individually
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* improve naming
* add comment
---------
Co-authored-by: github-actions <github-actions@github.com>
* Use createReduxStore instead of deprecated registerStore
* Move thunks to correct file
* Fix type definitions
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* changelog
* reduce diff size
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Remove todo
---------
Co-authored-by: github-actions <github-actions@github.com>
* add: tracks for skip guided setup
* moved recordSkipGuided setup to skip guided setup step
* lint
* moved it further
---------
Co-authored-by: rjchow <me@rjchow.com>
In this PR, we consolidate TypeScript config files (using the 'include' setting) and JS test directory naming. The goal is to reduce the number of processed files during different build steps.
* Avoid duplicate custom classnames
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Refactor wc_get_customer_default_location to ensure only valid countries are selected
* changelog
* MIssing doc block
* Updates tests
* Update test
* stripos usage
* Use isset for country check
To reduce wp-env startup crashes in CI, bump the ut's version to the latest and downgrade the MariaDB version used under the hood to 11.2. Related to https://github.com/WordPress/gutenberg/issues/62242, since it's addressed, we are good to remove the patch.
* Change e2e test to use plugin slugs instead
* Changelog
* Add data-slug in plugin screen, set remote variant for more predicability, change to use plugin slugs
* Update code to be clearer