Commit Graph

19563 Commits

Author SHA1 Message Date
jonathansadowski 9b98a85380
Remove docs plugin from monorepo (#44013)
* Remove docs plugin from monorepo

* Add language to md-docs readme

* Fix lint error in blocks

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-23 16:16:07 -06:00
Adrian Moldovan d66a48e8e5
[e2e tests] Add tests for product images (#43775)
* Import media on environment setup

* Add product-images.spec with one complete test and all other skeleton tests

* Add changelog

* Implement can update the product image

* Implement can delete the product image

* Implement can delete the product image

* Skip not implemented test

* Merge fixtures

* Add productWithImage fixture

* Remove unused variable `api`

* Partial implementation of can create a product gallery

* Check the image gallery in store frontend

* Added `can update a product gallery` test

* Run all tests

* Search for image in media library

* Check that the remove gallery image is not displayed

* Add repeatEach configuration

* eslint formatting

* Extract some repeating steps into a function

* Update check for thumbnail

* Fix test image name
2024-01-23 13:31:22 -08:00
Maikel Perez 9f3c7885a4
Remember downloadable files (#44008)
* The previously uploaded file should re-appear when the product changes from downloadable to not and then back again

* Add changelog file

* Fix php linter error
2024-01-23 14:53:22 -03:00
louwie17 1a4ebebf6a
Fix description toolbar with latest GB version (#43835)
* Initial changes to fix the toolbar in the iframe editor

* Moved toolbar to header and respect fixedToolbar preference

* Only render Gutenberg toolbar with specific version

* Update GB version

* Fix build issue

* Add fixed toolbar menu

* Remove unused import

* Add changelogs

* Fix lint errors

* Fix PHP lint error
2024-01-23 11:17:37 -04:00
Maikel Perez 26a546954a
Hide Downloads section under Toggle (#43864)
* Add Include downloads to show/hide the Downloads section

* Fix margin top for none first child nested sections

* Add changelog files

* Fix php linter errors
2024-01-23 12:12:52 -03:00
Maikel Perez dbae7d6661
Create product-pre-publish-modal feature flag (#43861)
* Create product-pre-publish-modal feature flag

* Add changelog file

* Fix auto formatting change
2024-01-23 11:46:52 -03:00
Maikel Perez 7ec8f7932e
Variations tab should be moved to the second tab, after General (#43998)
* Move variations tab to position 2 so it will appear right next to the general tab

* Add changelog file
2024-01-23 11:45:59 -03:00
Niels Lange 30dfa013f9
Unskip e2e tests (#43852)
* Remove obsolete comment

* Unskip cart and checkout translation tests

* Unskip shipping method switching tests

* Unskip template-related e2e tests

* Unskip order confirmation test for guest users

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

* Adjust broken e2e tests

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-23 21:32:10 +07:00
Alba Rincón a44a45b56a
CYS Redirect to intro screen if theme is not modified (#43736)
* Redirect to intro screen if theme is not modified

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

* Add and fix test for the redirection

* Redirect with the proper url 'intro'

* Remove only

* Avoid completing the cys task when switching themes

* Revert prev commit and reset `woocommerce_admin_customize_store_completed` before each test

* Set the `woocommerce_admin_customize_store_completed` to `no` before each test

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-23 11:15:19 +01:00
Alfredo Sumaran 4fd42aa7c5
Apply Rector suggestions for PHP 8.1 (#43236)
* PHP 8 Updates for src/Internal

* Add changelog entry

* Fix PHP lint issues

* Add unit test for not in queries.

---------

Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
2024-01-23 15:32:46 +05:30
Ilyas Foo 8a1af8a432
Add "I'm selling online and offline" for Square credit card payment recommendation (#43816)
* Add online offline for Square credit card

* Lint

* Changelog

* Update plugins/woocommerce/src/Admin/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

---------

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2024-01-23 13:52:27 +08:00
Sam Seay 42e77d4938
[Experimental] Product Filter - Reintroduce Wrapper Block (#43688) 2024-01-23 18:29:24 +13:00
Chi-Hsuan Huang 9b7d9ce689
Update the onboarding profile API validation for `business_extensions` parameter (#43806)
* Update the validation for business_extensions parameter

* Add changelog
2024-01-23 10:53:16 +08:00
Justin Palmer 8baa07e029
Remove `UTM` from Order Attribution metabox labels (#43041)
* Rename order attribution template file
* Update OA field name to `source_type` to keep up with https://github.com/woocommerce/woocommerce/pull/41690
* Discard conditional UTM labels altogether

---------

Co-authored-by: Tomek Wytrębowicz <tomalecpub@gmail.com>
2024-01-23 01:40:05 +01:00
Damián Suárez 0940201c37
Add suggested-products product endpoint (#43720)
* init approach of related products endpoint

* register related prodducts endpoint

* rename response prop with ids

* filter categoris from endpoint params

* filter categories when pulling related products

* changelog

* extend from WC_REST_CRUD_Controller class

* iterate over defininf endpoint params

* doc

* merge product terms with params

* introduce `combine` param

* return products collection instead of plain array

* fixinf eslint issues

* pass proper fn args to bound fns

* do not call parent register method

* post type is defined by parent controller class

* remove related products controller

* extend products controller with `related-products`endpoint

* filter post__in param

* when no related products found return empty array

* change and register endpoint params

* remove commented line

* add a custom method to extend the params

* update

* fix typo

* ensure to respect the products limit

* fix eslint issue

* remove unrequired endpoint id param
2024-01-22 17:18:02 -03:00
Christopher Allford db8da8d712
Properly Configured Wireit Production Builds (#43716) 2024-01-22 10:13:45 -08:00
Tarun Vijwani 139150134f
Add store notices to the Cart and Checkout block templates (#43753)
* Fix session notices in Cart and Checkout block pages

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

* Update plugins/woocommerce-blocks/assets/js/base/components/notice-banner/style.scss

Co-authored-by: Niels Lange <info@nielslange.de>

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2024-01-22 21:25:42 +04:00
Néstor Soriano 7c62443ebe
Improve the logging/noticing of Legacy REST API usages (#43851)
* Include request IP address in the logging of Legacy REST API usages

* Add link to the Legacy REST API plugin to the usage notices
2024-01-22 17:02:19 +01:00
Alfredo Sumaran e48849444c
Apply Rector suggestions for PHP 8.1 (#43235)
* PHP 8 updates for src/Database/*

* Add changelog entry

* Update changelog entry
2024-01-22 15:30:31 +00:00
Barry Hughes f6fbb42652
Optimize performance of `WC_Install::is_new_install()`. (#43767) 2024-01-22 16:08:05 +01:00
Mike Jolley 18cd0a9690
[Experimental] Surface custom fields in Emails (#43519)
* Get default attributes on front end

* Remove console log

* Show notice about 0 registered fields in editor

* Do not show block in editor if no fields are registered

* Wrapper block

* Update webpack config

* Wrapper block type definition

* Separate fields from the hook block

* Hide when no custom fields exist

* Address and contact fields

* Shared form fields in settings

* Revert render_content to original

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

* Get default attributes on front end

* Add initial sections to email templates

* Revert "Get default attributes on front end"

This reverts commit f76c21617a2c5ad832d4579ba2c4c8e98afd440d.

* Also render contact fields

* Handle plain text

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

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

* Unwanted changes from rebase

* Use get_order_additional_fields_with_values

* Remove sample fields

* Version bump for styles

* Update plugins/woocommerce/includes/class-wc-emails.php

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Update plugins/woocommerce/includes/class-wc-emails.php

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Apply view context

* Handle null

* Context

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2024-01-22 13:56:22 +00:00
Thomas Roberts 4114c5a5f1
[Experimental][Refactor] Reduce complexity of custom field registration function (#43663)
Co-authored-by: github-actions <github-actions@github.com>
2024-01-22 05:48:23 -08:00
Albert Juhé Lluveras c1b131c869
Add e2e tests to verify specific theme templates have priority over user-modified Product Catalog template (#43750)
* Add e2e tests to verify specific theme templates have priority over user-modified Product Catalog template

* Add changefile(s) from automation for the following project(s): woocommerce-blocks
2024-01-22 14:44:07 +01:00
Albert Juhé Lluveras 550bfe3572
Update WC Blocks Playwright tests docs so we pass parameters correctly to PNPM scripts (#43779) 2024-01-22 11:20:59 +01:00
Alba Rincón 95ed989ab4
Fix handling the error from the `product_image_upload` and `update_product_content` functions (#43793)
* Fix handling the error from the `product_image_upload` function

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

* Fix linting errors

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-22 09:59:51 +01:00
Thomas Roberts 7dabf2b031
[Experimental] Add `$request` to additional fields validation filter (#43789)
* Add $request to additional fields filter

* Add changelog entry

* Add data to additional message
2024-01-19 23:21:47 -08:00
Veljko V 7f2fd37fad
Refactor code and merge checkout and coupon tests and add new restricted cart coupons tests (#43819)
* Add changelog and update var naming in block tests

* Format code in two tests

* Add missing payment method set to the test

* Refactor tests and merge cart checkout coupons

* Clear cookies before every test
2024-01-19 10:32:19 -08:00
Mike Jolley 60509aa539
[Experimental] Surface additional checkout fields values in Admin order page. (#43748)
* Get default attributes on front end

* Remove console log

* Show notice about 0 registered fields in editor

* Do not show block in editor if no fields are registered

* Wrapper block

* Update webpack config

* Wrapper block type definition

* Separate fields from the hook block

* Hide when no custom fields exist

* Address and contact fields

* Shared form fields in settings

* Revert render_content to original

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

* Show address placeholders

* View fields in admin

* Pass order object and context to field hooks in WP admin

* CheckoutFieldsAdmin class

* Move logic to CheckoutFieldsAdmin

* Implement context

* Style checkboxes correctly in meta box

* Update handling

* Undo change to changelog

* Correct docblock comment for woocommerce_admin_shipping_fields

* Document context

* No need to init fields

* Fix checkbox handling for bw compat reasons

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

* Force CI

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

* Fix CSS rule

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-01-19 11:35:17 +00:00
Luigi Teschio f866d0d30f
[CYS - Core] Improve loading screen (#43791)
* CYS - Core: Create dummy products

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

* CYS - Core: Improve loading screen

* fix import

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

* update image

* add missing image

* fix CSS

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-19 12:03:19 +01:00
Jonathan Lane a0988461ec
[E2E] Tests for coupon usage restrictions (#43590)
* Changelog

* Tests for restricted coupons

* Update to test checkout not cart… which is what I should have been using

* Removal -- from PR feedback

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-01-19 10:49:24 +01:00
Alfredo Sumaran f2e90aa01d
Apply Rector suggestions for PHP 8.1 (#43237)
* PHP8 Fixes for templates dir

* Add changelog entry

* Bump template version

* Bump template version number

* Update changelog entry

* Typo
2024-01-19 10:07:53 +01:00
Alfredo Sumaran 5b6897e690
Apply Rector suggestions for PHP 8.1 (#43229)
* Apply Rector suggestions

* Add changelog entry

* Update changelog entry

* Fix PHP Lint errors
2024-01-19 10:07:06 +01:00
Niels Lange 32282a00ce
Add tracking for incompatible extensions (#42816)
* Add tracking for incompatible extensions

* Separate tracking data
2024-01-19 13:03:33 +07:00
Chi-Hsuan Huang 5bdc56e287
Fix activity panel showing incorrect currency (#43733)
* Fix activity panel showing incorrect currency

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

* Use store currency setting when order currency is different from the store currency

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-19 12:20:36 +08:00
Atanas Penchev 32ca8c16f2
Replace FlexSlider $.fadeIn() with vanilla .animate() (#41979)
* Vanilla .animate() instead of jQuery .fadeIn()

* Slider .animate() keyframes are now a list with 2 objects

[{ marginLeft: old }, { marginLeft: new }] keyframe syntax instead of
{ marginLeft: [old, new] } keyframe syntax for consistency

* Changelog

* Tweak changelog.

---------

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2024-01-18 15:30:51 -08:00
Ivan Stojadinov 50b4275174
[e2e] Expand simple product creation with more details (#43710)
* Expand 'can create simple non-virtual product' test

* Expand 'can create simple non-virtual product' test

* revert line break

* changelog add

* Revert "changelog add"

This reverts commit 0aa8f62cf7.

* Changelog - add update details

* Use getBy* where appropriate

* Add more geyBy*s

* Add more geyBy*s #2

* Add API calls to delete category and tag

* Update productCategory
2024-01-18 09:59:15 -08:00
Gan Eng Chin 6246cf6ff2
Marketing: Add "Sales" column in Campaigns card (#43284)
* Add sales property to MarketingCampaign class.

* Return campaign sales data in API.

* Display Sales in Campaigns card.

* Fix test for useCampaigns.

* Display a "-" when there are no cost or sales value in Campaigns card.

* Add changelog.

* Fix test for useCampaigns hook.

* Fix PHP lint issue.
2024-01-19 01:42:35 +08:00
Luigi Teschio c6e5d0d504
CYS - Core: Create dummy products (#43784)
* CYS - Core: Create dummy products

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 15:52:49 +01:00
Alba Rincón 589259f39f
[CYS on Core] Intro screen - Update the copy depending on whether the user already started to customize their store (#43690)
* Add new banner for no-Ai existing theme

- Add new banner
- Update copy
- Refactor the theme preview structure

* Make preview optional

* Remove log

* Remove unused param

* Fix linting error

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 14:59:10 +01:00
Niels Lange 7cd04dfa5a
Add e2e test to hover Mini Cart totals (#43693)
* Add e2e test to hover Mini Cart totals

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

* Optimise hover test

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 20:06:28 +07:00
Thomas Roberts bf61e57ce4
Ensure "email" field id does not include the section ID (#43734)
Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 04:33:50 -08:00
Albert Juhé Lluveras 91d0e16151
Convert block templates tests to parametized tests (#43778)
* Convert block templates tests to parametized tests

* Use frontendUtils.addToCart() when possible

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 13:29:07 +01:00
Albert Juhé Lluveras 6c3f8cb6fb
Add e2e tests to verify block templates can be customized if the theme has its own custom templates (#43650)
* Update commands to run e2e tests

* Capitalize Product Catalog template name

* Create tests with block theme with templates

* Create Block Theme with Templates test environment

* Update classic theme commands

* Code cleanup

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

* Code cleanup (II)

* Add config to blocks-playwright.yml and remove unnecesssary .github/workflows/playwright.yml file

* Remove unnecessary imports from product-catalog-template.block_theme_with_templates.spec.ts

* Update blocks e2e commands to pnpm

* Replace hardcoded strings with a variable

* Unify all 'block theme with templates' tests in a parameterized test

* Create a testData object for the Mini-Cart template part test

* Fix some code styling issues

* Create a testData object for the Mini-Cart template part test (II)

* Remove duplicate userText variable

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 11:39:24 +01:00
Manish Menaria 8c284a5074
[Product Collection] Add unique ID attribute (#43314)
* Add unique ID attribute to Product Collection block

In this update, we introduced a unique identifier for each instance of the Product Collection block. This change involves several key modifications:

1. **Block JSON Update**: Added a new `id` attribute in `block.json` to store the unique identifier for each block instance.

2. **Product Collection Content Update**: In `product-collection-content.tsx`, we utilized the `uuid` library to generate a unique ID. This is done in a `useEffect` hook, ensuring that each block instance receives a distinct ID upon initialization.

3. **Type Definitions**: The `ProductCollectionAttributes` interface in `types.ts` was updated to include the new `id` attribute, aligning with our enhanced data structure.

4. **Package Dependencies**: To support this feature, `@types/uuid` and `uuid` were added to `package.json`, ensuring we have the necessary tools for ID generation.

This enhancement is pivotal for uniquely identifying each Product Collection block, paving the way for more robust and individualized block handling in the future.

* Rename uniqueId to id

* Add lock file

* Add 'id' context to product collection and template

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

* Merge trunk with 42861-introduce-a-unique-identifier-for-each-product-collection-block

* Regenerate the lockfile

* Remove autogenerated change in plugins/woocommerce/package.json

* Regenerate lock file

* Rerun CI actions

* Delete pnpm-lock.yaml file & regenerate it using pnpm install command

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 15:30:57 +05:30
Luigi Teschio 0a98e5acd6
[CYS - Core] Switch to TT4 when the flow starts (#43740)
* CYS - Core: add unit test

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

* fix description

* Enable TT4 when the customize your store process starts

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-17 15:09:12 +01:00
Matt Sherman 824dc6be51
Remove BlockTemplateRegistry (#43589) 2024-01-17 07:12:12 -05:00
Vlad Bozdog 4966697b7f
41827-improve-coupon-usage-by-user-query-performance (#43731)
The sql query can be slow on big data sets, because the post meta value is type of string, and we are quering with a number.
2024-01-17 11:29:28 +01:00
Vedanshu Jain 90b3e11dba
HPOS: Remove buggy check in the data cleanup tool. (#43727)
* Add refund order to unit test.

* Remove buggy defensive check since existance of order is already verified.

* Changelog.

* PHPCS fixes.

* Added more assertions after cleanup to verify cleanup worked.
2024-01-17 14:58:11 +05:30
Chi-Hsuan Huang 8b567dcbc7
Update payment partners 2024 q1 (#43514)
* Remove eway and zipco

* Add Airwallex

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

* Fix lint

* Update airwallex images

* Fix category_other value

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-17 09:40:08 +08:00
Alexandre Lara 8258919e22
Product Gallery block: Remove the experimental flag from the Product Gallery block (#43586)
* Remove the experimental flag from the Product Gallery block

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-16 21:05:47 -03:00