Commit Graph

8954 Commits

Author SHA1 Message Date
barryhughes 9bfd8535f7 Be more specific: we only expect WC_Product types at this point. 2023-01-17 15:54:59 -08:00
barryhughes c41eccc58e Check a valid product object was obtained before calling its methods. 2023-01-17 15:40:52 -08:00
Barry Hughes ebae81ccaf
Small edit to the tooltip text (#35107) 2023-01-17 15:16:30 -08:00
Barry Hughes 8495c5f779
fixing typo in name of country in states(i18n) file (#36457) 2023-01-17 15:15:49 -08:00
barryhughes 4bb137637f Update API tests re revised email image header tooltip text. 2023-01-17 13:59:36 -08:00
barryhughes 1fb60677fc Changelog. 2023-01-17 13:47:32 -08:00
Gan Eng Chin f616d688d8
Call marketing channels API with wp.data. 2023-01-18 02:04:42 +08:00
Barry Hughes 2bf9f57795
Restore pre-7.2.0 quantity selector behavior (#36460)
Prior to 7.2.0 the quantity input was hidden if input min and max were identical (either because the product was sold individually, or because of min/max products config). This change restores that behavior, but makes it possible to render the input in readonly mode if desired (via filters).
2023-01-17 17:06:25 +01:00
Matthias Kittsteiner 0f78e32216
Add context to countries shipping to prefix (#36254)
Closes https://github.com/woocommerce/woocommerce/issues/36242
2023-01-17 10:39:10 +01:00
Joel Thiessen d9daad3e9c
Converting product details section to utilize slot fills (#36368)
* Working prototype of product details via slotfill

* Raising default order for product slot-fills

* Move logic to details field name component

* Adding order prop to all fills.

* Adding components changelog

* Adding changelog

* Deleting obsolete product details section files

* Reducing spacing between slot filled fields
2023-01-17 05:04:58 -04:00
Joshua T Flowers ea64a98f54
Extract attribute filtering and fetching logic out of attribute components (#36354)
* Move attribution fetching to separate hook

* Add changelog entry

* Set all attributes on update of subset of attributes

* Move filtering logic to hook

* Remove tests that filter attribute by type inside the component

* Rename AttributeField to AttributeControl and props from attributes to value
2023-01-17 04:34:08 -04:00
Willington Vega 6377314b1b
Remove deprecated usage of `${var}` syntax in strings (#36439)
* issue-35763/fix-php-8.2-deprecation-warnings

* Declare $mockable_functions property

* Declare $mockable_classes property

* Fix deprecated usage of ${var} in strings

* Add changelog file

* Avoid using interpolation to create SQL statement

We could ignore the PHPCS error. However, ignoring the error leaves
PHPCS unable to detect future changes that may introduce unsafe
interpolation.

I think the more verbose approach is the safest approach in this
case.

* Ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared

There doesn't seem to be a way to use a variable name for the name of the table without
triggering a PHPCS error.

* Avoid interpolated passing interpolated variables to __()

* End inline comments with a full-stop
2023-01-17 10:47:00 +08:00
Barry Hughes f4af1b7a84
Get the first array item for the alt_text. (#35009) 2023-01-16 16:28:32 -08:00
Priyanka Behera 3719b62dad
Fixed - woocommerce_order_tracking shortcode causes fatal error if a refund ID is entered #31760 issue (#33735)
* Fixed #31760 issue

* additional space removal after &&

* Make sure tracking shortcode only tracks orders of type `WC_Order`

* Add changelog

Co-authored-by: Jorge A. Torres <jorge.torres@automattic.com>
2023-01-16 16:31:48 -03:00
Mahdi Taleghani 497119b622
fixing a typo in i18n states file 2023-01-16 21:23:55 +03:30
Nima 7e27c0d67a Add changelog 2023-01-16 17:12:16 +00:00
Vedanshu Jain d58a6035a6
Include WC Cart functions for REST API calls (#36182) 2023-01-16 20:00:18 +05:30
Joel Thiessen 2dce575449
Adding ProductForm data store (#36430)
* Removing overriding functions in Section.php

* Adding changelog

* Adding product form data store

* Adding data package changelog
2023-01-16 08:13:55 -04:00
Nima b82421fa48 Merge branch 'trunk' into feature/34548-multichannel-marketing-backend 2023-01-16 12:06:38 +00:00
Vedanshu Jain b1489ca796
Properly handle product filtering query vars when front page is ‘shop’ (#36224) 2023-01-16 17:00:25 +05:30
Néstor Soriano 443b563335
Upgrade PHPUnit to v8 and stop using patched PHPUnit 7 for PHP 8 (#36273)
* Upgrade PHPUnit to v8, and remove usage of PHPUnit7 fork in CI

Once the minimum WordPress version supported by WooCommerce is 5.9
and the minimum PHP version supported is 7.2, we can switch to
PHPUnit 7 and the patched PHPUnit 7 with support for PHP 8 is
no longer needed.

* Resolve PHPUnit 8 deprecations in tests

* Add changelog file

* Fix code formatting
2023-01-16 20:58:09 +13:00
Sam Seay 235709ebf7
Enable Live Branches feature in WooCommerce Beta Tester (#36407) 2023-01-16 18:31:08 +13:00
Fernando Marichal c5a27cbd55
Add advanced setting option (#36380)
* Modify feature flag

* Add tooltip to WC > Settings > Advanced > Features

* Add Settings option

* Add `optional_features` and `beta_features` option

* Add changelog

* Fix lint

* Fix lint

* Add `new_product_management` to legacy features

* Fix escaped tooltip

* Fix `Analytics pages` e2e tests

* Fix `Payment setup task` e2e tests

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2023-01-13 17:04:02 -03:00
Barry Hughes 8ad92c4c82
Order emails: improve responsiveness and RTL support (#36310)
* Tweak email layout/styling. This should improve responsive properties for RTL emails particularly.

* Further improve layout consistency across a range of mobile email clients.

* Update existing code to match current coding standards.

* Further PHPCS fix.

* Update sample email to match recent changes in our default email CSS.
2023-01-13 16:48:27 -03:00
Barry Hughes f84042a823
[HPOS] Add support for ordering by metadata in order queries (#36403) 2023-01-13 10:20:49 -08:00
Barry Hughes 5d10f08e28
Widen the selector used to hide the quantity input (#36384) 2023-01-13 09:19:04 -08:00
Nima Karimi b2ff0ba1a2
Multichannel Marketing - API (#36222)
* Rename `get_errors_no` to `get_errors_count`

* Remove the validation for marketing channel slugs

Do not check if the marketing channel's slug exists in the list returned by WooCommerce.com Recommendation API. This essentially allows any third-party extension to register as a marketing channel.

* Revert InstalledExtensions

The InstalledExtensions class will be used by the previous generation of Marketing dashboard (if the user has not enabled the new "Marketing" feature); therefore, it's best to restore it to the original code.

* Fix code style

* Add channel property to MarketingCampaign

* Add methods to filter the recommended marketing channels and extensions

* Add `marketing/recommendations` API

* Add unit tests for `marketing/recommendations` API

* Add `marketing/channels` API

* Add unit tests for `marketing/channels` API

* Add `marketing/campaigns` API

* Add unit tests for `marketing/campaigns` API

* Translate Exception message

* Remove doc references to predetermined list of marketing channels

* Add `unregister_all` method

To allow unregistering all marketing channels.

* Unregister all channels on test tear down

* Change API access denied authorization code

* Change API access permission

* Add MarketingCampaignType class

This allows defining campaign types for each marketing channel.

* Add campaign type property to campaign class

* Add `marketing/campaign-types` API

This API returns the aggregated list of supported marketing campaign types for all registered marketing channels.

* Add unit tests for `marketing/campaign-types` API

* Remove unused jsonSerialize method

* Fix unit tests

Co-authored-by: Nima <nima.karimi@automattic.com>
2023-01-13 19:54:48 +03:00
nigeljamesstevenson 1eed9a4fc9
update k6 readme variable names (#36398) 2023-01-13 16:40:42 +00:00
Matt Sherman 69e7fd1b42
Analytics: Decode HTML entities in CategoryBreadcrumbs (#36321)
* Decode HTML entities in CategoryBreadcrumbs

* Changelog
2023-01-13 11:14:40 -05:00
barryhughes dc2a0ff774 Changelog. 2023-01-12 16:26:54 -08:00
Paul Sealock 1772babf91
Security update 242 (#36408)
* Customers REST API: return user metadata only when requester has an administrator role

* Add changelog file

Co-authored-by: Nestor Soriano <konamiman@konamiman.com>
2023-01-13 13:14:42 +13:00
Sam Seay 0f4bf6c8f4
Bump stable tag and update changelog for 7.2.3 release. (#36385) 2023-01-13 13:11:54 +13:00
Jorge A. Torres 65bf167a4d Make PHPCS happy xD 2023-01-12 18:26:16 -03:00
Jorge A. Torres 0ce815d464 Add changelog 2023-01-12 18:02:12 -03:00
Jorge A. Torres fd7099824e Add unit tests 2023-01-12 18:02:07 -03:00
Jorge A. Torres e4efa941e9 Implement sorting order queries by metadata 2023-01-12 18:02:02 -03:00
Jorge A. Torres 22edb1f67f Build a list of flat meta_query clauses when processing meta queries 2023-01-12 18:01:29 -03:00
Jorge A. Torres f1b49e76e5 Fix PHPCS issue 2023-01-12 18:01:03 -03:00
louwie17 04d371b7e0
Add product form api functions (#36165)
Co-authored-by: Joel <dygerati@gmail.com>
2023-01-12 12:33:06 -08:00
Fernando Marichal 78002eac9c
Hide `Variations` section when it is empty (#36202)
* Add changelog

* Hide Variations section when it is empty

* Fix hiding variations

* Remove `totalCount const

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2023-01-12 16:32:40 -03:00
Joshua T Flowers 891ecb7efb
Redirect to new product experience when in experiment group (#36381)
* Redirect to new product experience when in experiment group

* Add changelog entry
2023-01-12 16:02:40 -03:00
Joshua T Flowers ad59769f25
Remove persisted query on return to parent product from variation (#36365)
* Remove persisted query on return to parent product from variation

* Add changelog entry
2023-01-12 09:20:46 -08:00
Matt Sherman 54c0acf8cd
Decode HTML entities in CategoryFieldItem (#36367)
* Decode HTML entities in CategoryFieldItem.

* Changelog
2023-01-12 10:21:43 -05:00
louwie17 11af1e6381
Add/36019 php product form helper classes (#36093)
* Add initial PHP classes for field registry with tests

* Add README

* Add changelog

* Add sorting to get fields and add test for this

* Update location to section

* Fix lint errors

* Address PR feedback and add Card and Section classes

* Fix php unit test

* Some more cleanup and consolidation of product form component logic

* Fix tests and linting

* Rename Card to Subsection and move some logic around

* Rename Form to FormFactory

* Fix lint errors
2023-01-12 04:39:38 -04:00
Matt Harrison e588c560bf
Update spelling of Cancelled to Canceled for US English. (#36294)
* Update spelling of Cancelled to Canceled for US English.

This only updates output display text that uses US English. All code that uses
the form Cancelled is unchanged and is perfectly fine to stay as Cancelled.
(since it is behind the scenes and would require changes in other plugins)

For languages where Cancelled is preferred such as UK English the approprate
form can be applied in the translation files.

Fixes https://github.com/woocommerce/woocommerce/issues/25847

* add changelog file

* Update plugins/woocommerce/tests/api-core-tests/tests/settings/settings-crud.test.js

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

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2023-01-12 12:13:36 +08:00
Sam Seay 11b46d4f77
Add a new set of CLI commands to WooCommerce Beta Tester (#36339) 2023-01-12 14:16:01 +13:00
barryhughes 83c946602a Widen the selector used to hide the quantity input (for products that are sold individually). 2023-01-11 15:25:12 -08:00
Joel Thiessen 6e428201c1
Adding WooProductSectionItem slotfill (#36331) 2023-01-11 10:00:20 -08:00
nigeljamesstevenson 0490311829
k6: update order requests for HPOS add tidy scenarios (#36174) 2023-01-11 16:08:08 +00:00
Maikel David Pérez Gómez 8bada412d4
Product variations should inherit parent product properties (#36234)
Remove manage_stock 'parent' value before saving the variation
2023-01-11 11:41:25 -03:00
Vedanshu Jain b3bd207baa Enable COT Tests for all PRs. 2023-01-11 09:31:11 +05:30
github-actions[bot] 4ab70c5e7d
Delete changelog files based on PR 36170 (#36172)
Delete changelog files for 36170

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2023-01-11 07:19:51 +13:00
Joel Thiessen f429b9444c
Adding WooProductFieldItem slotfill (#36315) 2023-01-10 10:13:02 -08:00
Rodrigo Primo 1d234b5ac0
Update TaskLists::add_task() to reflect changes in TaskList::add_task() (#36104)
* Update TaskLists::add_task() to reflect changes in TaskList::add_task()

In
8ff08ea0c9 (diff-061f664bd417ad78d47c53ad5e6cc7e2eb1243af4e55b6fbf68750225acb06a3R173)
`TaskList::add_task()` was refactored to receive an instance of `Task`
instead of an `array` as its first parameter.

This commit updates `TaskLists::add_task()` (easy to miss that it is a
different method as the only difference is the plural in the class
name) to reflect the changes from the commit mentioned above. It
updates the type of the second parameter from `array` to `Task` and
renames the parameter from `$args` to `$task`.

I found this while using `TaskLists::add_task()` to add a MailPoet task
as our PHPStan checks complained that I was passing the wrong parameter
to this WooCommerce method.

* Add missing changelog file
2023-01-10 08:13:49 -08:00
Barry Hughes 301182fc8a
When product is sold individually, hide quantity selector (#36350) 2023-01-10 09:49:59 +01:00
barryhughes a1ce90b306 Changelog. 2023-01-09 10:05:26 -08:00
Gan Eng Chin b326ba1204
Merge branch 'feature/34903-multichannel-marketing-frontend/main' into feature/34903-multichannel-marketing-frontend/34906-channels-card 2023-01-09 23:38:03 +08:00
Gan Eng Chin 1b1d70925e
Merge branch 'feature/34556-marketing-api' into feature/34903-multichannel-marketing-frontend/main 2023-01-09 23:36:42 +08:00
Joris Van Steenberghe 0774e0506a Make sure setting sort order of all variations takes private variations into account (#32833) 2023-01-09 13:48:36 +01:00
Barry Hughes 0f37590021
Validate Norweigan postcodes/rework code for 4-digit post code validation (#36277)
Also gather countries that use four digit postcodes in one single case in the `switch` statement.

Co-authored-by: Stian <stian@dekode.no>
2023-01-09 12:11:22 +01:00
Vedanshu Jain 01e8a2029a
Make HPOS UX more consistent with posts (so that same e2e tests passes). (#36282) 2023-01-09 12:08:06 +01:00
Alexandre Faustino af9389d50d
Adds 2 new order status filters for bacs and cheque email instructions (#35849)
Co-authored-by: Néstor Soriano <konamiman@konamiman.com>
2023-01-09 11:52:41 +01:00
Néstor Soriano b03cb80c0c
Fix: order refunds REST API endpoint reading from posts table even with HPOS active (#36308)
Move HPOS-aware orders retrieval code from REST API v3 to v2. 

This has two effects:

1. Make the /orders endpoint compatible with REST API v2 when HPOS
   is active, additionally to v3 (v1 would require additional work).

2. Fix the /orders/<id>/refunds endpoints for v2 and v3, which was
   retrieving data from the posts table even when HPOS active

The class hierarchy is: RefundsV3 extends RefundsV2 extends OrdersV2
and OrdersV3 extends OrdersV2.

Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
2023-01-09 10:59:22 +01:00
Lucio Giannotta 74768f4c56
Update WooCommerce Blocks to 9.1.4 (#36314)
This update removes compatibility of the “Products (Beta)” block from
WordPress versions below 6.1.
2023-01-09 08:02:17 +13:00
Maikel David Pérez Gómez 1ab678c13f
Include tax options in pricing section (#36299)
* Add Charge sales tax on sub section to pricing section when enable taxes is set to yes

* Add tax classes datastore

* Load tax classes in pricing section

* Set empty value when tax class is standard rate

* Add changelog files

* Add custom resolver to use slug as id for tax classes

* Add helper text and learn more link to tax class radio group
2023-01-06 09:41:45 -03:00
Fernando Marichal 230e79fbdf
Fix reordering items logic in attributes/options lists (#36296)
* Fix reordering list items bug

* Add tests

* Remove orphan comment

* Add changelog

* Rename const

* Update plugins/woocommerce-admin/client/products/fields/attribute-field/utils.ts

Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>

* Rename `objectKey` to `attributeKey`

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
2023-01-06 08:53:03 -03:00
Joshua T Flowers 8b905b92c0
Allow product tab navigation without prompting for unsaved changes (#36235)
* Add callback to confirm whether or not the prevent leaving page prompt should trigger

* Move prevent leaving logic to util and add tests

* Add changelog entry

* Add navigation changelog entry

* Fix WooCommerce data mock

* Revert desctructuring of nav properties
2023-01-05 18:30:36 -08:00
Joshua T Flowers 04089f37e6
Add product variation flag to hide WIP (#36311)
* Add product variations feature flag

* Add changelog entry
2023-01-05 18:30:23 -08:00
Vedanshu Jain 4c236bdc37
Use more generic selectors for HPOS<>Posts compatibility (#36284)
* Use more generic search selector for edit screen.

* Use more generic heading text for post<>HPOS compat.
2023-01-05 10:26:08 -08:00
Vedanshu Jain 677896c304
Add support for sorting by includes param. (#36215) 2023-01-05 22:17:14 +05:30
Néstor Soriano b15639ee6a
Fix bug when filtering for customer_id=0. (#36216) 2023-01-05 14:41:23 +01:00
Vedanshu Jain dab19a3ec9
Set child orders to be children of current order parent before deleting. (#36218) 2023-01-05 15:24:49 +05:30
Vedanshu Jain dec29bc959 Merge branch 'trunk' into fix/35852 2023-01-05 14:59:17 +05:30
Vedanshu Jain cb8c6f8b24
Remove duplicated statement.
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2023-01-05 14:57:33 +05:30
Vedanshu Jain f36a16cd06
Update changelogger to 3.3.0 to support PR number capturing with merge (#36266)
* Update changelogger.

* Add changelog.

* Update changelogger for all packages.

* Add changelogs.

* Update changelog for remaining packages.
2023-01-05 14:42:51 +05:30
Vedanshu Jain 584167746e
Skip custom search for HPOS API queries as it's handled already. (#36213)
* Skip custom search for HPOS API queries as it's handled already.

For HPOS, we don't need a seperate step of passing the args through wc_order_search since we take care of search params in the final query itself. This duplication was actually causing for some results to not be displayed since we were ending up not honouring pagination arguments and would search only in first 10 matches.

* Add changelog.
2023-01-04 15:08:22 -05:00
Vedanshu Jain e84c38504f
Speed up search query by using GROUP BY instead of DISTINCT for HPOS (#35897)
* Spped up the search query by using GROUP_BY.

Search query peforms much faster when using group by, MySQL does not like it when we use DISTINCT and join different tables.

* Add changelog.

* Fixup for calculating found orders seperately.

* Code standard fix.
2023-01-04 14:57:01 -05:00
IanDelMar e0b829413d
Make coupon code label accessible (#36247)
* Make coupon code label accessible

* Changelog, version tag bump.

Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
2023-01-03 19:40:18 -08:00
Joshua T Flowers e73fb9f23f
Derive product type from product attributes (#36243)
* Derive product type from product attributes

* Add tests around derive product type

* Add changelog entry
2023-01-03 16:25:21 -08:00
Joshua T Flowers 421fc3e30b
Convert HTML to blocks in product variation description (#36241)
* Convert HTML to blocks in product variation description

* Add changelog entry
2023-01-03 16:25:12 -08:00
Sam Seay 302dab0521
Update browserslistconfig for legacy JS assets (#36264) 2023-01-04 11:22:15 +13:00
rodelgc 7ecdd50365
E2e/fix obw industry spec (#36260)
* Fix 'can save industry changes' test

* Add changelog

* Wait store details contents to load
2023-01-03 12:42:47 -08:00
Joshua T Flowers df0ddb2dff
Fix navigation between variations and tab selection (#36239)
* Fix navigation between variations and tab selection

* Add changelog entry
2023-01-03 08:59:49 -08:00
Nima 02cd258b44 Add unit tests for `marketing/campaign-types` API 2023-01-03 15:00:23 +00:00
Nima 1b668d94f3 Add `marketing/campaign-types` API
This API returns the aggregated list of supported marketing campaign types for all registered marketing channels.
2023-01-03 14:55:52 +00:00
Nima 8ef6532a07 Add campaign type property to campaign class 2023-01-03 14:55:06 +00:00
Nima 1687416413 Add MarketingCampaignType class
This allows defining campaign types for each marketing channel.
2023-01-03 14:54:03 +00:00
Nima 20efcfb804 Change API access permission 2023-01-03 14:05:27 +00:00
Fernando Marichal af9f493c43
Fix attributes/options lists corrupt render (#36236)
* Fix attributes/options lists reordering

* Add changelog

* Fix element key

* Remove comment

* Add tests

* Fix changelog

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2023-01-03 10:33:29 -03:00
Nima 264c92a52f Change API access denied authorization code 2023-01-03 11:27:31 +00:00
Sam Seay 4c876e51c6
Add combobox and extra status information to the live branches menu in WooCommerce Beta Tester (#36140) 2023-01-03 12:03:41 +13:00
Vedanshu Jain e4d2b00681 Applied coding standards. 2023-01-02 17:16:56 +05:30
Vedanshu Jain b9fd1b8129 Add test for upshifting child orders. 2023-01-02 17:03:06 +05:30
mujuonly d4ce6faf1e
Typo correction in woocommerce/src/Admin/ReportsSync.php (#36122)
Co-authored-by: Néstor Soriano <konamiman@konamiman.com>
2023-01-02 12:11:37 +01:00
Barry Hughes c2b2eb5bed
Adds `add_meta_boxes_<SCREEN_ID>` hook to the HPOS order editor. (#35999)
Co-authored-by: Néstor Soriano <konamiman@konamiman.com>
2023-01-02 12:10:14 +01:00
Vedanshu Jain be97c1353b Add test for sorting by include param. 2023-01-02 16:20:25 +05:30
Thilina Pituwala a633ff8abf
Fix signature mismatch in WC CLI command api calls (#36240) 2023-01-02 11:34:20 +01:00
Roy Ho 0d641253ac
Revert "Automatically show attributes in Variations" (#36223)
Revert "Automatically show attributes in Variations (#35807)"

This reverts commit e4f6c468cb.
2023-01-02 10:07:30 +13:00
Joshua T Flowers 3fe3710c51
Automatically generate product variations on option changes (#36188)
* Auto generate variations on option changes

* Add changelog entry

* Move product variation generation to hook

* Create product auto draft if not yet created

* Allow auto-draft and trash statuses for products

* Update form context with product ID to allow fetching variations

* Fix product ID usage in variations

* Reset form after initial product creation

* Use form value name for display instead of persisted name for auto drafts

* Add additional test around auto draft title
2022-12-30 13:12:09 -08:00
Joshua T Flowers c9748dda09
Add ability to filter variations by local attributes in REST API (#36201)
* Allow filtering of variations by local attributes in REST API

* Add changelog entry

* Fix up lint errors
2022-12-29 12:23:35 -08:00