* Register order route
* Get order it
* Add order schema
* Check authorization for getting the order
* Add order data to the response
* Add order schema for the endpoint
* Move validation check to order controller
* Update the error codes
* Add order item schema
* Check if the order is associated with current user
* Update order schema to match cart schema
* Update order item schema to match cart item schema
* Add product item trait
* Update sold individually property
* Allow guests to pay for order
* Update wording for logged out customers
* Allow getting all orders from the endpoint
* Add inline explanation for pay_for_order capability
* Remove unused $user_id and $order variables
* Remove duplicate pay_for_order capability check from validate_order_key
* Update exception wording when missing order id or key, or user mismatch
* Ensure $order_key is not null to avoid fatal error when left blank
* Resolve linting errors in order route class
* Adjust order ID description
* Create an abstract item schema
* Remove unused properties
* Remove unused properties
* Add billing email validation
* Allow to use the order endpoint in dev build only
* Add order status property
* Fix coupon and fee handling
* Update documentation for feature flags
* Update typo in total fees tax
* Update typo in tax lines
* Add missing payment methods to cart response
---------
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Remove styles from `Newest arrivals` pattern
* Remove id
* Replace row with columns to be able to stack blocks on mobile
* Make string translatable
* Make button string translatable
* Add new Product Average Rating block
* Add new blocks to the feature flag docs
* Translate 'No ratings'
* Fix condition
* Small improvements after review
* Avoid duplication of styles
* Update supports in php class
This commit adds a new `__experimentalExpandOnFocus` attribute to the component within the `HandPickedProductsControl`. The value is set to `true`, enabling automatic expansion of the list when the user focuses on the product selection field.
This change aims to improve the user experience by making it easier for the user to see all available options when they focus on the selection list.
* Create Mini-Cart template part area
* Update Mini-Cart template part name to exclude it
* Update src/BlockTemplatesController.php
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
* Update src/BlockTemplatesController.php
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
* Keep both variations of the template part name when excluding them
* Revert "Keep both variations of the template part name when excluding them"
This reverts commit c3f293511536d1ebbac0f50caaf74cded28d0025.
---------
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
* Add cors check
* refactor logic
* Refactor add_cors_headers to allow null and allowed hosts
* Move remove_filter inline
* Revert unrelated code style changes
* Add explainer to docblock
* Remove access for null origin
* Move CORS handling to auth class so it applies API wide
* Move only Authentication to priority 11
* Handle preflight requests so cart-tokens work
---------
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Mini Cart: Replace the deprecated print_inline_script() with supported get_inline_script_data(). Fixeswoocommerce/woocommerce-blocks#10004
* Mini Cart: Add version check for the new get_inline_script_data() function
* Update the variable names and fix a typo
* Mini Cart: Add regex to check for the WP version
* Abstract the WP version comparison regex to a separate Utils class
* Remove queries that fetch all products for manipulating the results returned by the Store API for certain use-cases.
* Remove the code that's supposed to read product ids for filter context and logic around that in useCollectionData
* Fix incorrect merge
---------
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
* Remove queries that fetch all products for manipulating the results returned by the Store API for certain use-cases.
* Keep support for Product Collection block
* Rating start block improvements
Fix classes, register in single product, remove unused code
* Allow to use block on product & product collection
* Fix star missalignment
* Restrict the block to be insertable only in single product
Key updates:
1. Additional CSS class to Inherit Query Control: A CSS class named `wc-block-product-collection__inherit-query-control` has been added to the ToggleControl component. This provides a precise target for E2E tests and potential custom styles.
2. E2E tests for 'Inherit query from template' control: Numerous scenarios have been covered to ensure the control's correct behavior. These scenarios include verifying visibility under different circumstances and checking its functionality in a Product Catalog template.
3. E2E test code enhancements: The E2E test code now exports the `SELECTORS` object to assist in locating different elements during the tests. This includes the new 'Inherit query from template' control. The `setShowOnlyProductsOnSale()` function has been refactored to improve readability and provide more granular control over its operations.
4. Test scenario for 'Show only products on sale': The existing E2E test for this functionality has been extended to check that it retains its state when the 'Inherit query from template' control is toggled.
These changes increase the robustness of our E2E tests, providing better coverage for the 'Inherit query from template' control in the Product Collection block.
* allow for handling classic theme template part support
Note this logic is currently not right - just a quick implementation for testing POC
* Account for classic theme support of template parts
* Update supports_block_templates signature so it accepts the template type instead of a bool
* Simplify logic in supports_block_templates
* Test
* Fix supports_block_templates check to test correct template type
---------
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Foundation of the Products block replacement with Product Collection
* Provide logic to replace Products with Product Collection
* Make sure the blocks can be replaced
* Add types and refactor replacement a bit
* Fix the query attributes transform
* Add upgrade Notice to the Product Collection block
* Force upgrade notice to be displayed at the top of the Inspector Controls
* Externalise migration code so it can be reused in both ways
* Add util to get block IDs byt its name
* Add a way to revert the Product Collection blocks to Products
* Move the subscription to another place where it's triggered only once
* Add default values
* Remove attributes from Products block if they're not used to avoid incorrect query
* WIP logic of unseen/seen/reverted notice
* Change the state reading
* Revert changes regarding notice displaying logic
* Change the logc of firing replacement and bail early if there's no core/query blocks
* Add todos
* Implement inner blocks migration
* Implement the revert transformation of inner blocks
* Refactor types
* Add layout transformation from Products to Product Collection
* Add layout migration from Product Collection to Products
* Disable migration by default
* Simplify some parts of code
* Remove additional keyword from Product Collection to move it to another PR
* Adjust the logic to introduce the first step: conversion from Products to Product Collection
* Disable automatic migration
* Refactor Columns Control inspector controls in Product Collection
* Refactor Order By inspector controls in Product Collection
* Reorder imports in Product Collection Inspector Controls
* Refactor On Sale inspector controls in Product Collection
* Refactor Stock Status inspector controls in Product Collection
* Refactor Keyword inspector controls in Product Collection
* Unify interface of query controlling Inspector Controls
* Unify interfaces of Inspector Controls that modify Query in Product Collection
* Unify other Query modifying Controls
* Simplify types