This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 218
[Product Collection] Add Price Range Filter #11931
Closed
Closed
Commits on Nov 24, 2023
-
Add Price Range Filter to Product Collection Block
- Introduced 'priceRange' attribute in the DEFAULT_QUERY and DEFAULT_FILTERS within `constants.ts` to initialize the new price range filter. - Added new SCSS rules in `editor.scss` for styling the price range control. - Implemented `PriceRangeControl` in `inspector-controls/index.tsx` to enable users to specify a price range for product filtering. - Created `PriceTextField.tsx` and `index.tsx` under `inspector-controls/price-range-control`, providing the UI for entering minimum and maximum price values. - Extended the `ProductCollectionQuery` and `PriceRange` interfaces in `types.ts` to type-check the new price range functionality. - Updated `ProductCollection.php` to handle the price range data when constructing the product query, ensuring products are filtered based on the specified price range.
Configuration menu - View commit details
-
Copy full SHA for 96bead2 - Browse repository at this point
Copy the full SHA 96bead2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0eb7ef2 - Browse repository at this point
Copy the full SHA 0eb7ef2View commit details
Commits on Nov 28, 2023
-
Enhanced Price Range Control with Currency Symbol and Flexible Width
- Removed the `max-width` restriction from `.wc-block-product-price-range-control` in `editor.scss`. - Introduced currency symbol support in `PriceTextField.tsx` by importing `getCurrency` from `@woocommerce/price-format`. The currency symbol is now displayed as a suffix in the price input fields, providing a clearer context for the prices being entered. - Implemented `step="any"` attribute in `NumberControl` within `PriceTextField.tsx`. This modification allows for more precise price inputs, accommodating prices with decimal values.
Configuration menu - View commit details
-
Copy full SHA for d796e7c - Browse repository at this point
Copy the full SHA d796e7cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3c9bc75 - Browse repository at this point
Copy the full SHA 3c9bc75View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4be9688 - Browse repository at this point
Copy the full SHA 4be9688View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7f68a58 - Browse repository at this point
Copy the full SHA 7f68a58View commit details
Commits on Nov 29, 2023
-
Configuration menu - View commit details
-
Copy full SHA for dd696bf - Browse repository at this point
Copy the full SHA dd696bfView commit details
Commits on Dec 7, 2023
-
Update ProductCollection to handle tax-adjusted price filters
The changes primarily focus on the following areas: 1. **Tax Adjustment Incorporation**: The logic now includes an adjustment for tax considerations. This is facilitated by the newly added `should_adjust_price_range_for_taxes()` method, which determines if the price filters need to be adjusted based on the discrepancy between price storage and display methods concerning tax inclusion. 2. **Tax Class Handling**: A new method `adjust_price_range_for_tax_classes()` has been implemented. It adjusts the price range for each tax class, ensuring accurate and relevant calculations. This method is essential for handling various tax scenarios and classes, improving the accuracy of price range filtering. 3. **Price Adjustment Logic**: The `adjust_price_value_for_tax_class()` method has been added for detailed tax adjustments. This method adjusts price values based on tax classes and the tax display settings, using logic akin to `wc_get_price_excluding_tax` and `wc_get_price_including_tax` from WooCommerce core. 4. **Meta Query Construction**: A new method `build_meta_query_for_price_range()` constructs the meta query for filtering products within the specified price range. This method simplifies and consolidates the meta query construction process. Overall, these changes aim to make the price filtering feature more robust, especially in scenarios involving different tax setups. The update enhances the module's flexibility and accuracy in handling diverse pricing scenarios.
Configuration menu - View commit details
-
Copy full SHA for bfb21bc - Browse repository at this point
Copy the full SHA bfb21bcView commit details
Commits on Dec 8, 2023
-
Merge branch 'trunk' of https://github.com/woocommerce/woocommerce-bl…
…ocks into 9360-product-collection-filters-price-range
Configuration menu - View commit details
-
Copy full SHA for 3d30f34 - Browse repository at this point
Copy the full SHA 3d30f34View commit details -
Configuration menu - View commit details
-
Copy full SHA for c07536c - Browse repository at this point
Copy the full SHA c07536cView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.