Commit Graph

62282 Commits

Author SHA1 Message Date
Patricia Hillebrandt de9322fb38
[CYS] Update the neutral color palette to black and white (#43114)
* Update the neutral color palette to black and white.

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-27 09:30:08 -03:00
Patricia Hillebrandt 589617a41d
CYS > Update AI-generated site title, image optimizations and updated directory structure (#43086)
* Remove the last business description check to allow repetition.

* Create the new AIContent directory and update the structure and name of the classes.

* Ensure the store title is updated with new AI-generated content if the previous title was also AI-generated.

* Return if the images result in error.

* Update the name of the option for fetching the AI generated site title.

* Introduce the new adjust_image_size method for shared usage between products and patterns.

* Increase the quality of images used in patterns

* Introduce the ContentImageProcessor class.

* Undo PatternsHelper rename

* Add changefile(s) from automation for the following project(s): woocommerce

* Address lint errors

* Ask AI to summarize the business description if the number of characters provided by the user is bigger than 150 characters.

* Rename the ContentImageProcessor class to ContentProcessor and introduce the new summarize_business_description method.

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-27 08:33:37 -03:00
Karol Manijak 37155abb0c
New flow of adding Product Collection and basic set of Collections (#42696)
* Migrate PR to Core

* Migrate test changes

* Add Custom Collection with inherit query attribute disabled

* Update copy of Product Catalog collection

* Don't choose default active collection in polaceholder and remove highlight

* Remove inherit query option from inspector controls

* Add collection names to Product Catalog and Custom one

* Unify Collection Chooser between Modal and Placeholder

* Bring back util removed by accident

* Replace the translations domain with woocommerce

* Remove leftovers after merge

* Add pagination and no results to Product Catalog and Custom collections

* Revert textdomain change

* Fix lint error

* Add changelog entry

* Change collection label

* Bring back Inherit query from template

* Remove Custom collection and bring back single Product Collection

* Simplify applying collection

* Make sure Inherit query from template is enabled in archive templates by default and disbaled in posts/pages

* Change incorrect Playwright locator

* Add test for Product Catalog inheriting the query in product archive

* Add tests for recommendation collection hiding the predefined filters

* Add reviews to multiple products

* Update expected products in Top Rated

* Remove rating creation in test env and skip undeterministic tests

* Add skip to Best Sellers test

* Update README.md

* Add more keywords to collections, like 'product collection' to recommendation collections

* Rephrase the README note about Collections registration

* Simplify types

* Rename unchangeableFilters to hideControls

* Fix typo in file name

* Remove 'pattern' references from toolbar files

* Replace hardcoded SCSS color with wc variable

* Remove changelog file from different PR

* Move hideControls to Product Collection ayttributes

* Improve responsiveness of columns in Product Collection Placeholder

* Use admin color pallette in Product Collection Placeholder

* Move Inherit query from template to the top of Inspector Controls

* Change the Collection prefix to woocommerce rather than woocommerce-blocks

* Simplify Placeholder and Modal styles
2023-12-27 11:07:27 +01:00
Maikel David Pérez Gómez 2a4c4e8e1e
Product template association (#43120)
* Load the product template from the product meta data

* Save product template id as part of the product meta data

* Add changelog file

* Fix linter error
2023-12-26 15:11:17 -05:00
Damián Suárez 5ee2447145
[Product Block Editor]: Introduce AdviceCard component (#43082)
* introduce AdviceCard component

* import advice card styles

* add onDismiss() prop

* tweak border style

* implement dashed border

* log the onDismiss function

* changelog

* tweak layout

* tweak card border style
2023-12-26 15:54:29 -03:00
jonathansadowski 2700d80614
Fix async version bump bug (#43122) 2023-12-26 10:49:48 -08:00
Damián Suárez 300e79ac7f
[Product Block Editor]: fix feature flag to hide the Linked products (#43119)
* fix flag to hide/show product editor

* changelog
2023-12-26 14:14:43 -03:00
github-actions[bot] 0f880ff7a2
Delete changelog files based on PR 43074 (#43118)
Delete changelog files for 43074

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2023-12-26 22:44:02 +08:00
Luigi Teschio 7cb10704ff
fix: CYS - change heading color (#43076)
* fix: CYS - change heading color

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-12-26 09:07:52 -03:00
Tung Du c2cab76069
Fix: Collection data being leaked between Collection Filters blocks (#43044) 2023-12-26 16:13:30 +07:00
Damián Suárez 67e01c1f6b
[Product Block Editor]: introduce ShoppingBags component (#43042)
* add ShoppingBags component

* Add ShoppingBag story

* changelog
2023-12-25 09:21:29 -03:00
Damián Suárez 7be2481381
[Product Block Editor]: add Linked product sections. First approach. (#43013)
* add Linked products, Upsell section

* changelog

* add Cross-lens section

* add links to the Upsell sections

* changelog

* fix lint issues

* fix lint issus

* fix linting issue :-|

* check whether the linked product group is defined
2023-12-22 18:44:44 -03:00
Damián Suárez 7f2b1c42fd
Revert "Fix schedule sales error" (#43094)
Revert "Fix schedule sales error (#42700)"

This reverts commit 9b800aa179.
2023-12-22 18:20:56 -03:00
Luigi Teschio 99aeaff6dd
set WOOCOMMERCE_BLOCKS_PHASE to 1 for the production build (#43074)
* set WOOCOMMERCE_BLOCKS_PHASE to 1 for the production build

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-22 17:43:53 +01:00
Thomas Roberts db17f27f02
Load google analytics gtag script asynchronously in WooCommerce Blocks (#43040)
Co-authored-by: github-actions <github-actions@github.com>
2023-12-22 08:42:11 -08:00
Tung Du 0c5d01a6ac
Interactive Price Filter: use `context` instead of `state` (#42980)
* feat: use context instead of state

* fix: temporary move the context to inner element for diffing to work

* fix: update context before navigation for optimistic UI
2023-12-22 22:05:31 +07:00
github-actions[bot] d14be998f5
Delete changelog files based on PR 43051 (#43081)
Delete changelog files for 43051

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2023-12-22 13:10:20 +01:00
github-actions[bot] 3ff4385e69
Delete changelog files based on PR 43033 (#43079)
Delete changelog files for 43033

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2023-12-22 13:08:07 +01:00
github-actions[bot] 6790d2558e
Release: Remove 8.5 change files (#43022)
Delete changelog files from 8.5 release

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
Co-authored-by: Alex López <alex.lopez@automattic.com>
2023-12-22 09:52:00 +01:00
Albert Juhé Lluveras 2da7b73e76
Add Playwright tests for All Reviews, Reviews by Product and Reviews by Category blocks (#42903)
* Remove Reviews blocks Puppeteer tests

* Minor code cleanup

* Typos

* Create publishAndVisitPost() editor util

* Fix subcategories when importing products in Playwright and add reviews

* Add Reviews blocks tests in Playwright

* More typos

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Create a 'reviews' object in data.ts so we can store reviews data in one single place

* Update test so instead of creating a new post in each test, we go to the already-created post

* Add source comments to reviews data to match it with the script

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-22 09:33:18 +01:00
github-actions[bot] a355346be2
Prep trunk for 8.6 cycle (#43021)
Prep trunk for 8.6 cycle with version bump to 8.6.0-dev

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2023-12-22 09:27:54 +01:00
Kyle Nel 92e1b932c3
Change marketplace install API request to POST instead of GET (#43033)
* Change marketplace install API to using POST instead of GET
* Fix linting error
* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-22 10:03:11 +02:00
Néstor Soriano a8b0f88bad
Introduce the transient files engine (#42877)
Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
2023-12-22 08:44:18 +01:00
Sam Seay 3eeeddfdb3
[Experimental] Interactivity Dropdown multi-select mode, ratings filter and introduce each directive (#42981)
---------
Co-authored-by: David Arenas <david.arenas@automattic.com>
2023-12-22 13:34:28 +13:00
Maikel David Pérez Gómez a592a473d3
Introduce a product type selection within the new experience (#41823)
* Create a relation between the product type and the product block template

* Add 'patterns' to name the kind of products that can be created for a specific template

* Resolve template using its id as a template query param

* Rename ProductEditPattern to ProductTemplate

* Rename get_patterns hook to woocommerce_product_editor_get_product_templates

* Return the list of templates to the client

* Set layout template events as array

* Register the layout template based on the product template or the post type in case of product variations

* Registering non supported product types

* Create and register the woocommerce/product-details-section-description block

* Add the product type to the section description

* Create product type selector

* Fix menu item style

* Highlight selected menu item

* Set the selected product template

* Set product template title to lowercase in the content description

* Rename blocks by blockTemplates under the AbstractBlockTemplate class

* Rename to woocommerce_product_editor_product_templates filter

* Remove product_template_ prefix from the supported_product_types map

* Rename get_formatted to to_JSON and convert the props to client side like

* Refactor get_product_templates

* Fix icon resolution

* Add a confirmation modal for unsupported product templates

* Add changelog files

* Remove product types using for testing

* Fix redirection when changing to a non supported product template

* Set the change button state to busy when it is saving the product

* Fix php linter errors

* Fix rebase conflict

* Move ProductTemplate to Automattic\WooCommerce\Admin\Features\ProductBlockEditor namespace

* Add the to_json definition to the BlockTemplateInterface

* Create default product template by custom product type if it does not have a template associated yet

* Fix some comments and product template creation validation

* Add support to load the product template icon from an external resource

* Fix php linter

* Fix the changelog description
2023-12-21 18:45:31 -05:00
Damián Suárez eac1a460f0
[Product Block Editor]: Add `Linked product` tab (#43009)
* add linked-products to group IDs

* add Linked Products tab

* tweak hideConditions condition

* changelog

* fix typo in doc comment
2023-12-21 16:00:32 -03:00
Marc Guay 65828db266
Update class-wc-gateway-bacs.php (#43054)
* Update class-wc-gateway-bacs.php

Fix typo in textdomain

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-21 19:54:12 +01:00
Fernando Marichal 350fb94d8d
Modify feedback modal actions (#43005)
* Adapt feedback modal actions

* Add changelogs

* Modify comments

* Fix tests

* Fix test
2023-12-21 15:42:47 -03:00
louwie17 9182efaaf6
Fix product task redirect to support grouped and external products (#43051)
* Rearrange product redirection logic to better accept grouped and external produc types

* Add changelog
2023-12-21 14:09:00 -04:00
Jonathan Lane a67a1c6efc
Add github reporter (#42974)
* Add github reporter

* Add changelog

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2023-12-21 09:07:54 -08:00
Moon dc26c5a8f4
Fix incorrect wpBody margin top value set by TasksReminderBar (#43020)
* Use clientHeight to set the correct marginTop -- height is not a valid property

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-21 08:43:50 -08:00
Alba Rincón b3db937d3a
CYS - Ensure the offline modal is displayed whenever AI is unavailable (#42949)
* Show the ai offline modal independently from the onboarding tour

* Add changefile(s) from automation for the following project(s): woocommerce

* Remove log

* Fix tests

* Add customizing parameter to avoid showing the aioffline modal when customizing

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-21 16:56:22 +01:00
Jaclyn Chen d1a8f91836
Analytics: add `date_type` parameter to override date type option for revenue stats (#42938)
* Add `date_type` parameter to revenue stats API for overriding the date type column.

* Update coding styles.

* Add changelog.

* Validate `date_type` value with strict matching.

* Add test cases for passing a valid/invalid `date_type` parameter.

* Remove extra validation on `date_type` value as it's already validated at the API level.

* Check for each allowed value of `date_type` in the test case.
2023-12-21 09:38:19 -04:00
Paulo Arromba 1219cadf10
Fix/ Count() warning/error on invalid data supplied by the filter `woocommerce_cart_shipping_packages` (#42964)
* Fixed count() warning on invalid data supplied by the filter.

* Add changefile(s) from automation for the following project(s): woocommerce

* Removed unnecessary if

* Ordered comment to match if-clause
2023-12-21 13:24:39 +00:00
Fernando Marichal 9b800aa179
Fix schedule sales error (#42700)
* Fix schedule sales error

* Add changelog

* Fix lint

* Fix variable product error

* Add clear cache

* Remove sale price fix from data-store-cpt

* Fix comment

* Remove cache cleaning

* Add unit tests

* Fix lint

* Modify get_price
2023-12-21 10:10:22 -03:00
Thomas Shellberg cf52b42e26
Add React Testing Library to the Woo AI plugin. (#42993)
* Add React Testing Library and the simplest of tests to verify tests can be run successfully.
2023-12-21 12:25:08 +01:00
Niels Lange 01ede130aa
Adjust indents of old notice styles (#43031)
* Clean up old notice styles

* Adjust vertical marging for error list items on TT theme

* Add changefile(s) from automation for the following project(s): woocommerce

* Delete obsolete CSS file

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-21 17:10:14 +07:00
Tom Cafferkey 505fe17db2
Product Hero Pattern: Fix button alignment (#42913)
Co-authored-by: github-actions <github-actions@github.com>
2023-12-21 09:31:23 +00:00
Tom Cafferkey a9550d8894
Store API: Add support to query product_variations by attributes (#42983)
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-12-21 08:09:06 +00:00
Tom Cafferkey 99fc85ae15
Block Hooks API: Add Tazza theme to the list of allowed themes for Mini Cart auto-insertion (#42900)
Co-authored-by: github-actions <github-actions@github.com>
2023-12-21 08:08:54 +00:00
Manish Menaria ba4f3d4d29
Add price range filter to Product Collection block (#42858)
* Add price range filter to Product Collection block

This update introduces a price range filter feature to Product Collection. Changes include:

1. Constants Update:
   - Added `priceRange` as undefined in `DEFAULT_QUERY` and `DEFAULT_FILTERS` in `constants.ts`.

2. Style Adjustments:
   - Added CSS for `.wc-block-product-price-range-control` in `editor.scss` to align the input text to the end.

3. Component Integration:
   - In `inspector-controls/index.tsx`, the `PriceRangeControl` component is now imported and integrated.

4. New Components:
   - `PriceTextField.tsx` and `PriceRangeControl/index.tsx` have been created to handle price range inputs in the Product Collection block.

5. Backend Integration:
   - `PriceRange` interface added in `types.ts` for type support.
   - In `ProductCollection.php`, a filter (`add_price_range_filter`) is added to modify the main query based on the price range, including adjustments for tax considerations.

Overall, this enhancement allows users to filter products within a specific price range. The backend adjustments ensure that the filtering respects tax settings and displays accurate prices.

* Fix formatting

* Fix: Price range filter not working on Editor

* Improve: Share logic between Frontend & Editor

* Add changelog

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Remove duplicate changelog file

* Enhanced Input Control for Price Fields

Key changes include:

1. **Switch to Input Control**: Replaced the NumberControl component with the more versatile InputControl. This offers better handling of currency formatting and user input.

2. **Currency Formatting Logic**: Added robust logic for formatting numbers according to the currency settings. This includes handling thousand separators, decimal places, and currency symbols.

3. **String-to-Number Conversion**: Implemented a function to convert user-entered strings back to numbers, accounting for currency symbols and separators. This ensures accurate parsing of user input for processing.

4. **Input Handling Improvements**: Modified the onChange handlers for minimum and maximum price inputs. Now, they correctly handle edge cases like undefined or zero values, maintaining consistency in the user interface and data processing.

* Refactor price range query handling

1. Introduction of a new method `get_price_range_query_args()` to encapsulate the logic for handling price range queries, especially for the two edge cases:
   - Prices excluding tax displayed including tax.
   - Prices including tax displayed excluding tax.

2. Removal of direct conditionals in the `get_query_results()` method, replacing them with a call to the new `get_price_range_query_args()` method. This makes the code more modular and easier to understand.

This refactor enhances readability and maintainability of the code, ensuring that special cases in price range filtering are handled more effectively.

* Remove unnecessary suffix prop

* Refactor PriceTextField formatting logic for currency

1. Conditional application of thousand separators: The code now checks for the existence of `currency.thousandSeparator` before applying it. This prevents potential errors when the separator is undefined.

2. Simplified decimal separator handling: Introduced a fallback for the decimal separator, defaulting to a period ('.') if not specified by the currency settings.

3. Enhanced readability and documentation: Added comments to clarify the purpose of code blocks, especially where currency symbols are added or removed, and where value normalization occurs.

4. Function renaming for clarity: Renamed `formatValueWithCurrencySymbol` to `formatCurrency`, which better reflects its purpose.

* Fix onBlur issue with PriceTextField component

Refactored the PriceTextField component to utilize useState for better state management. This change introduces a local state variable, 'newValue', to store the current value. The state updates occur in the handleOnChange function, ensuring that the component's state is managed efficiently. Additionally, a new function, handleOnBlur, is implemented to handle the onBlur event, updating the component's state when focus is lost. The handleEnterKeyPress function captures the 'Enter' key press, providing a more user-friendly experience by allowing users to confirm their input with the Enter key.

* Fix linting error

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-21 12:45:20 +05:30
Niels Lange 49d6b2058a
Link cross-sells product image to product page (#42904)
* Link cross-sells product image to product page

* Add changelog entry

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-12-21 11:13:47 +07:00
Justin Palmer cb0c42180a
Revise excluded order statuses for order attribution customer history (#42999)
* Better align excluded order statuses with WC Reports

* Update Tracks data to match updated customer order history count

* Add changelog

* Clarify code comment

* Exclude `checkout-draft` for block checkout/API orders.

* Remove unecessary array_map

Co-authored-by: Bartosz Budzanowski <bartosz.budzanowski@automattic.com>

* Use existing method to get un-prefixed order statuses

---------

Co-authored-by: Bartosz Budzanowski <bartosz.budzanowski@automattic.com>
2023-12-21 00:06:30 +01:00
Simran Vijwani 8e351f2f15
Add UTM group to product URL on the Discover page (#41967)
* Add utm_category to discover page

* Fix product category URL params

* Add changefile(s) from automation for the following project(s): woocommerce

* Update productCategory to productGroup in Discover and NoResults components

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: Simran <simran.kaur@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2023-12-21 02:13:52 +04:00
Dekadinious d8e01b23cd
Update documentation in class-wc-order-item-product.php (#41160)
* Update class-wc-order-item-product.php

* Changelog.

* Fix alignment.

---------

Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
2023-12-20 13:52:00 -08:00
Leif Singer 06dc19ebd4
Ensure the gateway activation email does not depend on the gateway title being stored in the settings option (#42992)
* use `method_title` for the email to the admin as that is better suited for an admin context

* do not require the title to be set in the updated option

* add the changelog file

* adjust the test, too

* appease the linter
2023-12-20 13:44:30 -08:00
Ilyas Foo 4a5373409b
Fix shipping cost formatting to respect shipping formula (#42916) 2023-12-21 10:25:43 +13:00
Kathy 4d7bf10c96
Use product-sale-price ID for hooks. Closes #42907. (#42908)
* Use product-sale-price ID for hooks. Closes #42907.

* attempt to add a changelog
2023-12-20 17:44:32 -03:00
Damián Suárez e1e1d3c593
[Product Block Editor]: add `product-linked` feature flag (#43006)
* Add product-linked feature flag

* cchangelog

* enable product-linked flag in dev for now

* set product-linked unavailable in prod
2023-12-20 16:41:00 -03:00
Daniel Dudzic 7122669d44
Product Gallery: Simplify the Product Gallery Pop-up (#42797)
* Product Gallery Pop-up: Simplify the pop-up for v1

* Product Gallery Pop-up: Update the Product Gallery template part contents

* Product Gallery Pop-up: Add changelog entry

* Product Gallery: Fix CSS linting errors

* Product Gallery Pop-up: Add an additional changelog entry

* Product Gallery Pop-up: Update changelog message

* Product Gallery Pop-up: Fix logic error
2023-12-20 19:03:01 +01:00