Commit Graph

22039 Commits

Author SHA1 Message Date
Thomas Roberts 56b3e56e6f
Fix lint issues 2024-10-04 16:51:11 +01:00
Thomas Roberts 86b10a1446
Add changelog 2024-10-04 16:51:11 +01:00
Thomas Roberts 3bad691d17
Prevent description and delivery_time getting too close 2024-10-04 16:51:11 +01:00
Thomas Roberts 196f7c3674
Prevent widows in Checkout block 2024-10-04 16:51:11 +01:00
Thomas Roberts 49acd6846e
Ensure delivery_time shows in the cart shipping calculator 2024-10-04 16:51:11 +01:00
Thomas Roberts 3f6d05fedb
Add @since tag to docblock 2024-10-04 16:51:11 +01:00
Thomas Roberts e706f65e76
Add getters for description and delivery time 2024-10-04 16:51:10 +01:00
Thomas Roberts c83c0ecbfd
Set description and delivery time when instantiating rate 2024-10-04 16:51:10 +01:00
Thomas Roberts 081b1f9a33
Add setter for description and delivery_time 2024-10-04 16:51:10 +01:00
Thomas Roberts e648edf38f
Add description and delivery time to constructor 2024-10-04 16:51:10 +01:00
Thomas Roberts f833964969
Add description and delivery time to $data 2024-10-04 16:51:09 +01:00
Narendra Sishodiya 37903778fb
Replace Congratulations view Buttons with Links (#51654)
* ../woocommerce-admin/client/customize-store/transitional/index.tsx

* Delete plugins/woocommerce/bin/composer/phpcs/composer.lock

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

* Delete plugins/woocommerce/bin/composer/phpunit/composer.lock

* Delete plugins/woocommerce/composer.lock

* Reverted the changes

* Reverted the changes

* Reverted the changes

* Reverted the changes

* Reverted the changes

* Reverted the changes

* Reverted the changes

* Implemented Suggested Changes

* Implemented Suggested Changes

* IMplemented the Suggestions

* Removed navigateOrParent as it is not needed.

* Updated test case in  index.test.tsx

* Revert the change

* Implemented suggestions

* Update transitional.spec.js

* Update transitional.spec.js

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
Co-authored-by: root <root@LAPTOP-I3Q9TGEL>
2024-10-04 17:10:24 +02:00
Néstor Soriano cbf98a0912
Add the Cost of Goods Sold related code and REST APIs for the product class (#51675)
* Fix a bug in FeaturesController.

The UI for a non-legacy feature was showing up greyed out
("UI disabled") when the setting that controls the feature
was off ("feature disabled").

* Add the CostOfGoodsSoldController class.

* Add COGS related properties/methods to the product and variation classes.
Also update the data stores appropriately.

COGS values will be stored in a "_cogs_total_value" product meta key,
but only when the value is not zero.

For variations, a flag indicating if the COGS value overrides
the parent value will be stored in a "_cogs_value_overrides_parent"
product meta key, but only when the value is true (stored as "yes").

* Add filters to customize the COGS related data as it gets loaded or saved.

* Add COGS related functionality to the REST API
(get/create/modify products and variations endpoints).
2024-10-04 11:57:52 +02:00
Néstor Soriano ddfa425062
Modify product import file check to use the WP filesystem API (#51540)
* Modify product import file check to use the WP filesystem API.

Otherwise it doesn't work on environments that don't have
a direct filesystem like e.g. WordPress VIP.

* Add the FilesystemUtil::get_wp_filesystem_method_or_direct method
2024-10-04 08:50:54 +02:00
Roy Ho 7c48112d4a
Fix product collection flaky sales filter option (#51897)
* Fix product collection flaky sales filter option

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-10-03 17:10:45 -07:00
Amin Abdolrezapoor ee4f1aad3d
Fix wrong type passed to `add_meta_boxes` action (#51598)
* Fix wrong type passed to `add_meta_boxes` action

* revert changed parameter of `do_meta_boxes` to `WP_Post` object

* Add `woocommerce_order_editor_add_meta_boxes` in order editor

* Move changelog entry to correct directory
2024-10-03 09:53:46 -07:00
Boro Sitnikovski d3765b43c0
Add BFCM promo (#51739)
* Populate `window.wcMarketplace` for Marketing > Coupons

* TEST CODE: Add promotions dummy data to the endpoint for now

See [this comment](https://github.com/Automattic/woocommerce.com/issues/21783#issuecomment-2376471712) as to how we plan to manage this through WCCOM

* Initial implementation of the `<PromoCard>` component

This commit does the following:

- Implement the `PromoCard` component
- Refactor the existing `Promotions` component
    - Extract types
    - Add support for conditional rendering based on `pathname`
    - Accept optional parameter `promoCardOnly`
- Renders `PromoCard` wherever needed, as requested in the project thread.

Some remaining TODOs:

1. Dismiss functionality
2. Tracking
3. Figma design adjustments
    - CSS styling (Flexbox in Marketplace, etc.)
    - Percent image, wherever needed
    - Background image
4. BWC testing (e.g. ensuring that "Get more for your money" banner still works)

* Make sure that WCCOM also returns path so that earlier versions of in-app marketplace don't break (path undefined error)

* Update T&C link

After https://github.com/Automattic/woocommerce.com/issues/21840

* Implement promo banner dismissal logic and tracks

* Styling the WooCommerce > Extensions version of the promo component.

- Tweaked data on `class-wc-admin-assets.php` to pass `style` and `icon` attributes for that promo.
- Moved promo on this page from the marketplace `Header` component to the `Content`, above the Sales Banner notices.
- Deleted `percent.svg` and moved its content into a React component.
- CSS tweaks for this style of promo.
- Changes to elements of `PromoCard` component to allow the layout for this style.

* Fixed some TypeScript issues.

- Added guard condition in case `promotion.id` is undefined.
- Returning null if it isn't - but below `useState` hook, so we conform to rules of hooks.
- Setting default value for `promotion.cta_label` to satisfy TypeScript, which expects a node.

Style tweaks to `.promo-cta`. Vertical centering of text, hover colour, margins.

* Remove unnecessary unique identifier for each promo, and use a smarter way (URIs) to gather the visibility data

* Lint

* Revert test code

* Changelog

* Better code comments

* Changed `promoCardOnly` attribute of `Promotions` to `format`, to allow for more types in future.

* Update plugins/woocommerce-admin/client/marketplace/components/promotions/promotions.tsx

Co-authored-by: Boro Sitnikovski <buritomath@gmail.com>

* Styling promo cards at different breakpoints.
Moved homescreen promo to after store management links.

* Added condition to merge array of promos with the main `$promotions` array.

* Added `useEffect` so we only record Track event for view of promotion once.
Changed Tracks prefix to the shorter `marketplace_promo_`.

* Added Tracks events for both formats of promotions, `promo-card`, and the original `notice`.

* Merging two style blocks.

* Passing `format` to `recordEvent` instead of hard-coding it.

* Addressing linter errors.

* Moved operation merging promos into the main array into a separate method for greater clarity.

* Moved Promotions component on WooCommerce > Home to below task list.

* Styling tweaks.
Increased schedule of `woocommerce_marketplace_cron_fetch_promotions` cron job to twice daily.
Added guard conditions in `Promotions` in case `window.wcMarketplace.promotions` isn't defined or isn't an array.

* Reduced SVG size to 72px.

* Fixing linter error.

* Style tweaks. Using WP components colour vars for CTA and dismiss links.

* Fixing linter error.

* Reverting change to `schedule_cron_event`, as this method will not be present if only this branch is cherry-picked.

---------

Co-authored-by: And Finally <andfinally@users.noreply.github.com>
2024-10-03 15:36:06 +01:00
Adrian Moldovan 2276fded32
[ci-jobs] Add support for beta and RC WordPress versions (#51814) 2024-10-03 11:28:47 +03:00
Karol Manijak 7d9dc8b08d
Remove Product Collection wrapping div (#51733)
* Remove Product Collection wrpping div

* Add changelog

---------

Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com>
2024-10-03 08:05:04 +02:00
Ivan Stojadinov 24a2e43bd4
[e2e] External - Consolidate `playwright.config.js` for WPCOM (#51857)
* Merge all listed /merchant files

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-10-02 23:15:28 +02:00
Alba Rincón 5c57da5e82
Add a retry mechanism to obtain the lock for inserting products through the API (#51735)
* Add a retry mechanism to the query to obtain the lock for inserting products in the API

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

* Log errors after failed attempts and delay 10ms for each attempt

* Fix lint

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-10-02 09:06:40 -07:00
Albert Juhé Lluveras ecfafb50b6
Add Products by Brand template label (#51846)
* Add Products by Brand user-friendly title to the New template popup

* Add changelog file

* Update WC_Brands class version
2024-10-02 16:24:45 +02:00
Maikel Perez 4d7d049477
CYS: Investigate multiple requests being made to the patterns endpoint (#51819)
* Notify wc/admin/options store changes after the data is saved in the server and not before

* Add changelog file

* Remove the subscription to the OPTIONS_STORE_NAME since its trigered many times, using useSelect instead

* Add changelog file
2024-10-02 11:08:49 -03:00
github-actions[bot] 9be9fd9707
Delete changelog files based on PR 51664 (#51850)
Delete changelog files for 51664

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-10-02 06:44:59 -07:00
Roy Ho 31c675f93d
Add order by sales filter option to product collection (#51790)
* Add order by sales filter option to product collection

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-10-02 06:16:16 -07:00
Nathan Silveira 682f3fbe76
Add Notice generic block for the new product editor (#51740)
* Add Notice generic block for the new product editor

* Create reusable block for Notices

* Add changelog

* Fix wrong generic type
2024-10-02 10:10:57 -03:00
Tung Du f50620039e
Fix: React error in filter blocks due to duplicated renders (#51840) 2024-10-02 19:20:10 +07:00
Roy Ho 64df8a22c5
Replace __experimentalGetGlobalBlocksByName with stable getBlocksByName (#51773)
* Replace __experimentalGetGlobalBlocksByName with stable getBlocksByName

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-10-02 05:19:42 -07:00
Ivan Stojadinov 9c514b3949
[e2e] External - Expand WPCOM suite, part 4 (#51424)
* Skip `can remove a coupon` - error 500

* Make elements more specific

* Skip two tests from order-emails.spec.js

* Skip `WooCommerce Page Load`

* Expand WPCOM suite

* Change hardcoded email address

* Unskip tests in order-emails.spec.js

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

* ESLint updates

* Check different locator for Marketing channels

* Skip "can receive completed email" for now

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-10-02 11:23:07 +02:00
Adrian Moldovan a7e6011816
[blocks e2e tests] Increase the shards number to 10 (#51842) 2024-10-02 08:42:53 +00:00
Arthur Normand 73e7d571ed
Fix: show correct attribute and price filter data on the category/tag template (#50341) 2024-10-02 08:16:50 +00:00
Tung Du 7bef8af7f2
[Experimental] Reliability fixes for new filter blocks (#51642) 2024-10-02 14:56:50 +07:00
Tung Du 5b0d44b906
Product Collection: fix price range posts clauses (#51676) 2024-10-02 05:30:26 +00:00
Christopher Allford b0e0a733d6
WooCommerce Asset Build Aliases (#43433) 2024-10-01 10:32:24 -07:00
Roy Ho 516b55b734
Ensure Product Collection filter names are consistently capitalized (#51779)
* Ensure Product Collection filter names are consistently capitalized

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

* Update e2e tests

* Add additional types and return empty string

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-10-01 06:56:59 -07:00
Adrian Duffell 53a56cca77
Add core feature for site visibility badge (#51664)
* Add site_visibility_badge feature

* Update feature check on badge

Previously the WooCommerce Admin LYS feature flag was used, however this is slated to be removed in an upcoming release. This is updated to use the core level feature flag for the badge.

* Add changelog

* Fix lint issues

* Revert "Fix lint issues"

This reverts commit cf05d2b74f.

* Lint fixes

* lint
2024-10-01 15:40:43 +08:00
Vladimir Reznichenko ce5f7cb471
[dev] CI: drop baseline caching in perfromance metrics job (#51804) 2024-10-01 09:05:53 +02:00
Alexandre Lara e48b0352fe
Blocks: Add missing `wp-block-woocommerce-{name}` to Add to Cart with Options, Product Image, Product Rating, Product Rating Stars, Product Rating Counter and Product Image (#51558)
* Add missing classnames for WP blocks

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

* Fix unwanted extra whitespace within class property

* Remove unnecessary whitespace in class attribute for the Product Image block

* Remove unnecessary whitespace in class attribute for the Product Rating block

* Remove unnecessary whitespace in class attribute for the Product Rating blocks

* Fix php lint errors

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Sam Seay <samueljseay@gmail.com>
2024-09-30 12:41:20 -03:00
github-actions[bot] 632b4e98f4
Delete changelog files based on PR 51577 (#51777)
Delete changelog files for 51577

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-30 15:50:59 +01:00
And Finally a64e227fdc
Fetch promotions in a WP Cron job (#51650)
* Getting promotions in a WP Cron job to make them async. We don't want this request to affect the performance of wp-admin. See https://github.com/woocommerce/woocommerce/pull/47262#pullrequestreview-2241835763.

* Changelog.

* Made callback method `update_promotions` public.

* Linter errors. Whitespace.
2024-09-30 15:49:58 +01:00
Vladimir Reznichenko d3b0f153ad
[dev] CI: feedback on updated perfromance metrics job (#51772) 2024-09-30 16:39:16 +02:00
github-actions[bot] 93b2ceb044
Delete changelog files based on PR 51734 (#51775)
Delete changelog files for 51734

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-30 14:55:18 +01:00
Boro Sitnikovski fae492632a
Fix subscription status and action items for free (lifetime) subs (#51628)
* Fix subscription status and action items for free (lifetime) subs

* Changelog

* Lint
2024-09-30 15:14:39 +02:00
Bart Kalisz 52d0b8c17d
Blocks E2E: Make test plugin namespace consistent (#51771) 2024-09-30 15:04:08 +02:00
louwie17 3826b8b2c3
Fix product form metabox issue on Safari 18.0 (#51734)
* Fix for styling issue in Safari 18

* Add changelog
2024-09-30 11:48:14 +00:00
github-actions[bot] 5907114d6e
Delete changelog files based on PR 51728 (#51770)
Delete changelog files for 51728

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-30 12:07:27 +01:00
Mike Jolley b852aff696
Remove alert role from informational notices (#51651)
* Remove alert role from informational notices

* changelog

* Status role
2024-09-30 11:54:34 +01:00
Jason Kytros 08b8dd99cc
Revert packages initialization timeline change (#51728)
* Revert packages initialization timeline change

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

* Fix lint errors

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-30 11:17:17 +01:00
Ivan Stojadinov 9b3073999b
[e2e] External - Expand WPCOM suite, part 5 (#51745)
* Handle notice if displayed

* Make `Reply to comment` more unique, and wait for comment area to disappear

* Skip on WPCOM - error 404

* Fix copy/paste error

* Make area more unique

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

* Expand WPCOM suite

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-30 11:17:07 +02:00
Weston Ruter 38a2b5b3d8
Coming Soon: Return empty string from template_include filter instead of null to avoid PHP fatal error with conflicting plugins using strict types (#51751)
* Return empty string from template_include filter instead of null

* Update phpdoc return tag

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
2024-09-30 10:53:57 +02:00