Commit Graph

65792 Commits

Author SHA1 Message Date
Thomas Roberts 6eb9d6a83d
Fix product count display on mini cart first render (#52124)
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
2024-10-23 15:50:13 +01:00
Moon 42c7d33dbb
Track skip guided setup click (#47194)
* 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>
2024-10-23 22:19:51 +08:00
Thomas Roberts cf8b0d5a1a
Prevent PHP `doing_it_wrong` warnings in extend-cart-checkout-block package (#52195) 2024-10-23 15:07:40 +01:00
louwie17 fa2ce01246
Fix upside down tooltip in variations table (#52242)
* Move rotate down to icon and make sure tooltip uses max content width

* Add changelog
2024-10-23 08:59:34 -03:00
Vladimir Reznichenko 21d14759b3
[dev] Monorepo: minor build speed improvement (tsconfig consolidation) (#52191)
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.
2024-10-23 13:48:36 +02:00
Luigi Teschio 1e8b6d6b76
Avoid duplicate custom classnames (#51910)
* Avoid duplicate custom classnames

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-10-23 12:52:28 +02:00
Mike Jolley a6d09c9133
Checkout: Fix default customer location and geolocation so only allowed countries get selected (#51885)
* 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
2024-10-23 11:33:28 +01:00
Vladimir Reznichenko ed7d8c8505
[dev] CI: reduce number of wp-env startup crashes (take 2) (#52254)
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.
2024-10-23 11:13:20 +02:00
Ilyas Foo 983326c6d6
Improve stability of core profiler extensions e2e tests (#52252)
* 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
2024-10-23 17:09:09 +08:00
Manish Menaria 6ca412f1ec
Add "Manual (menu order)" sorting option to Product Collection block (#52221)
* 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>
2024-10-23 13:39:15 +05:30
Karol Manijak 2793669edf
Hide All Products from inserter (soft-deprecation) (#52207)
* 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
2024-10-23 09:32:42 +02:00
Jason Kytros 24403c244e
[WC Tracker]: Track brands count (#52056)
* [WC Tracker]: Track brands count

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

* Handle case where the product_brand taxonomy doesn't exist.

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-10-23 09:39:49 +03:00
Manish Menaria dc8fdcfb9a
Product Collection: Fix "Products to show" inspector control not showing as expected on Cart template (#52186)
* 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>
2024-10-23 11:44:42 +05:30
Vladimir Reznichenko f954babd8b
[dev] CI: refine pr-lint-monorepo workflow filters (take 2) (#52102)
In this PR we refine filters for running 'Changelogger use' job to aim changes in packages and plugins directories.
This also invalidates the need for a top-level changelog directory, which we are removing as well.
2024-10-23 07:56:56 +02:00
Chi-Hsuan Huang 86dc2c8c1c
Change cache control to max-age=60 for coming soon pages (#52200)
* Update cache control header to 60s for coming soon pages

* Add changelog
2024-10-23 11:49:28 +08:00
Chi-Hsuan Huang 8f8a9a4bac
Fix OBW continue button overlaps with checkbox in mobile screens (#52205)
* Fix OBW continue button overlap with checkbox in mobile screens

* Add changelog

* Clean css
2024-10-23 11:32:22 +08:00
Luigi Teschio 733f025414
Stock Filter: Update block to the new structure (#51714)
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-10-23 10:13:17 +07:00
RJ c0ba0a99e0
fix: storybook product editor webpack path (#51996)
* fix: storybook product editor webpack path

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-10-23 03:04:20 +00:00
Chi-Hsuan Huang 154689eb44
Fix RTL CSS on the installation wizard (#52206)
* Fix RTL CSS on the installation wizard

* Add changelog

---------

Co-authored-by: Hamid Reza Yazdani <yazdaniwp@gmail.com>
2024-10-23 09:25:43 +08:00
Chi-Hsuan Huang a71c52789f
Fix mobile app modal UI (#52201)
* Fix mobile app modal UI

* Add changelog

* Fix mobile style
2024-10-23 08:38:33 +08:00
Chi-Hsuan Huang 6e0c754f64
Fix "Finish setup" icon remains if tasks are disabled without being completed (#52204)
* Fix "Finish setup" icon remains if tasks are disabled without being completed

* Add changelog

* Remove console
2024-10-23 08:34:48 +08:00
Chi-Hsuan Huang b69ba253f4
Fix LYS Whats Next actions (#52182)
* Fix LYS Whats Next Actions and Add Unit Tests

* Add changelog

* Fix marketing task and lint

* Fix tests
2024-10-23 08:33:03 +08:00
Gabriel Manussakis 88c2f97ba4
[Accessibility] Adjust color sales badge color contrast (#52080)
* Adjust color contrast of sales badge on TT1 theme

* Adjust color contrast of sales badge on TT4 theme

* Add changelog file
2024-10-22 15:09:31 +01:00
Luigi Teschio eea27c681d
Fix `Add To Cart form` layout in the post editor (#51662)
* 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>
2024-10-22 15:23:49 +02:00
Maikel Perez 8e2e666c17
CYS: remove GO_BACK_TO_HOME state (#52042)
* CYS: Remove GO_BACK_TO_HOME state from the Transitional screen

* Add changelog file

* Fix unit tests

* Redirect to the admin home page instead of the site home page
2024-10-22 10:05:05 -03:00
Mike Jolley 44fe60214a
Store API: Fix case sensitive coupon email validation (#52187)
* Force billing email lowercase in store API validation routine

* Changelog

* Update plugins/woocommerce/changelog/fix-50329-store-api-email-restrictions-case

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>

---------

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
2024-10-22 13:17:05 +01:00
Gabriel Manussakis bc446587aa
[Accessibility] Associate the shipping calculator button to its form in Cart page (#52126)
* Associate shipping calculator button to its form in classic Cart

* Associate shipping calculator button to its form in block Cart

* Add changelog file

* Bump shipping-calculator template version
2024-10-22 13:03:47 +01:00
Manish Menaria e28b0aa9ea
Product Collection: Support registering product collection that isn't displayed in Collection Chooser (#52057)
* 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>
2024-10-22 14:02:32 +05:30
Ames Plant c5faf64bfa
[Accessibility] Add screen reader text to the gallery trigger link and update it to a… (#50493)
* Add screen reader text to the gallery trigger link and update it to a button

* Fix linting error for line too long

* Fix linting double arrow alignment

* Update version

* Linting spacing fix

* Add a mixin for the product gallery trigger

* Move product gallery trigger to mixin and add a cursor state

* Remove unnecessary mixin import

* Add focus style to gallery trigger on TT1 theme

* Update gallery trigger mixin

* Update product gallery trigger markup

* Update changelog text

---------

Co-authored-by: Gabriel Manussakis <gabrielmanussakis@gmail.com>
Co-authored-by: Gabriel Manussakis <9420947+Manussakis@users.noreply.github.com>
2024-10-22 10:17:04 +02:00
Manish Menaria 0d9d06cd46
Fix: Upsells collection not showing correct products on frontend (#51730)
* 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

* Update variable name

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
2024-10-22 12:56:06 +05:30
Manish Menaria e6d0a906fb
Product Collection: Hide preview label when specific product is selected (#52150)
* 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>
2024-10-22 12:54:16 +05:30
Alba Rincón 25cc4630be
Adapt receipt to take into account order status (#51853)
This PR adds a new Payment status field to the order receipts.

* Adapt receipt to take into account failed orders

* Add missing param

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

* Add a new section to show the order status

* Remove unused css

* Replace order status by payment status, possible values are only failed or success

* Change logic to use order failed instead of order paid
2024-10-21 15:38:16 -07:00
louwie17 cd3d957bec
Update/storybook commands to use wireit (#51701)
* Integrated wireit to storybook

* Attempt at integrating wireit

* Update wireit dependencies for storybook package

* Add changelog

* Remove unneeded --if-present and regex in pnpm command

* Remove unneeded dependency for storybook build command

* Add missing dependency in blocks storybook build script
2024-10-21 20:14:55 +00:00
Barry Hughes 92063b0817
Revert #51598 (#52166)
* Revert changes made to (HPOS) order editor meta box hooks (original change: PR#51598).

* Restore method param (was inadvertently stripped).

* Provide further explanation re types supplied via `add_meta_boxes`.

* Changelog.
2024-10-21 10:17:05 -07:00
Francesco aeade9d9ac
fix: dark theme support for "change address" cart button (#51878)
* fix: dark theme support for "change address" cart button

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-10-21 16:06:17 +01:00
Fernando Marichal 2a89e91b58
Product Collection: Add Cross-Sells collection (#52068)
* Add cross-sells

* Fix block title

* Rename product_reference

* Add unit tests

* Add changelog

* Fix lint
2024-10-21 11:25:27 -03:00
Maikel Perez 3c2180f296
[CYS - Core] Unit Test: Add test for the util function to install fonts on the JS side (#52172)
* Remove duplicated fonts.ts file

* Add unit tests to check the getFontFamiliesAndFontFaceToInstall function

* Add changelog file
2024-10-21 09:47:45 -03:00
Francesco 1686b2c14b
fix: ValidatedTextInput attribute (#51971)
* fix: ValidatedTextInput  attribute

* lint in muh belly

* TDD

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

* undo props change

* custom error message prop

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-10-21 11:00:11 +01:00
Mike Jolley a882acc7e3
Fix notices caused by legacy fee dynamic properties (#52063)
* Define legacy fee dynamic properties

* changelog
2024-10-21 09:20:05 +01:00
Herman 5b3289264f
Do not show product card footer for Business Services products (#52118)
* Do not show product card footer for Business Services products

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-10-21 08:48:35 +02:00
Jason Kytros 782a3c7508
Run `wc_update_950_add_brands_enabled_option` on WC 9.5 update (#52051)
* Run `wc_update_950_add_brands_enabled_option` on WC 9.5 update

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

* Update wc-update-functions.php

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-10-21 09:15:31 +03:00
Chi-Hsuan Huang 9c5e7beb71
Remove options to re-enable setup task list after completion (#52146)
* Remove re-eanble setup tasklist option

* Add changelog

* Remove re-eanble setup tasklist option from settings when setup task has previously completed

* Use is_complete check instead
2024-10-21 12:05:18 +08:00
Chi-Hsuan Huang ebc486103c
Prepare 2.5.0 Beta Tester Release (#52181)
* Update changelog.txt

* Bump version

* Update composer.lock
2024-10-21 11:47:18 +08:00
Chi-Hsuan Huang 04ce5182a0
Fix ExtendStore Task Not Marked as Completed Upon Navigating Back to Home (#52127)
* Invalidate the task list completion when a task is clicked

* Add changelog

* Fix test
2024-10-20 23:41:30 +00:00
Chi-Hsuan Huang b5501426b4
Add tool to reset "Launch your store" and coming soon mode changes (#52149)
* Add tool to reset "Launch your store" and coming soon mode changes

* Update docs

* Update docs

* Address PR feedback
2024-10-21 07:22:16 +08:00
Gabriel Manussakis 3c076b5187
[Accessibility] Improve checkout error messages (#49094)
* Improve required info for screen readers on checkout fields

* Add style to inline error message on checkout fields

* Add id attribute to terms error

* Improve accessibility of checkout errors messages

* Prevent screen readers from reading the asterisk on checkout fields

* Revert spacing change

* Revert spacing change

* Add changelog file

* Decrease line length

* Lowercase the required term

* Fix query methods in checkout tests

* Add space before required text for screen readers

* Fix query of shipping fields on legacy checkout tests

* Remove asterisk from field name on legacy checkout test

* Remove invalid character in Phone and Email fields on legacy checkout test

* Add asterisk to get phone and email by label on legacy checkout test

* Fix field labels for legacy checkout tests

* Fix php lint errors

* Add required tem to the Government ID input on tests

* Revert changes on required fields label

* Create checkout-inline-error-message mixin

* Replace SCSS variable with a CSS one

* Add checkout inline error message to T17

* Add checkout inline error message to T19

* Add checkout inline error message to TT

* Add checkout inline error message to TT1

* Add checkout inline error message to TT2

* Add checkout inline error message to TT3

* Include notice banner block in the notice selectors

* Add inline documentation to role attribute removal

---------

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2024-10-18 18:00:46 +02:00
nigeljamesstevenson 864f5448d8
Update test-assistant-issue-review.yml 2024-10-18 16:23:20 +01:00
Joshua T Flowers 67fb81095f
Cache block asset resource hints (#51874)
* Cache block asset resource hints

* Combine resource hints under single cache transient

* Add AssetController tests

* Add changelog entry

* Skip cache use in development mode

* Fix up lint errors

* Revert init method back to protected and ignore linting

Co-authored-by: Mike Jolley <mike.jolley@me.com>

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2024-10-18 07:37:08 -04:00
Albert Juhé Lluveras 7125986053
Add sizes attribute to Product gallery thumbnail images to better load the appropriate resolution (#52073)
* Add sizes attribute to Product gallery thumbnail images to better load the appropriate resolution

* Add changelog file
2024-10-18 10:56:46 +02:00
Manish Menaria b4605c75e5
Fix: Multiple issues related to MySQL having ANSI_QUOTES enabled in Product Filters (#51316)
* Fix: Use prepared statements for stock status filtering

This commit addresses an issue where the "Filter by stock" block fails when used with MySQL that has ANSI_QUOTES enabled. The problem was caused
by the use of double quotes in the SQL query.

Key changes:
1. Replace direct string concatenation with wpdb->prepare()
2. Use placeholders for stock status values in the IN clause
3. Validate stock statuses against known options before querying

This fix ensures compatibility with different MySQL configurations and improves
the overall security of the query by preventing SQL injection vulnerabilities.

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

* Fix lint errors

* Fix lint issue

* Fix: Use single quotes for attribute taxonomy names in SQL query

- Addresses issue with Filter by Attribute block failing with ANSI_QUOTES enabled
- Prevents "Unknown column" errors for attribute names in SQL queries

* Fix: Use single quotes for SQL IN clauses

This commit addresses an issue where the Filter by Stock block fails when
the database has ANSI_QUOTES enabled. The problem was caused by the use of
double quotes in SQL IN clauses, which are treated as identifiers when
ANSI_QUOTES is enabled.

The fix involves replacing double quotes with single quotes in the following files:
1. plugins/woocommerce/src/Blocks/QueryFilters.php
2. plugins/woocommerce/src/StoreApi/Utilities/ProductQuery.php

This change ensures compatibility with databases that have ANSI_QUOTES
enabled, while maintaining the existing functionality for other configurations.

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-10-18 09:46:32 +05:30