Commit Graph

9093 Commits

Author SHA1 Message Date
Joshua T Flowers dfe2780e6a
Add default value for backorders (#36607)
* Add default value for backorders

* Add changelog entry
2023-01-26 09:20:10 -08:00
Willington Vega 7ef4fef53a
Fix dynamic property creation warning in `class-woocommerce.php` (#36545)
Declares $api as a public property to the WooCommerce class in order to avoid a deprecation warning that will eventually be an error in upcoming PHP versions.
2023-01-25 17:25:27 -08:00
Nathan Silveira a274057a6e
Create PHP helper functions for adding new tabs (#36583)
* Update documentation on how to add a new field through FormFactory

* Add method to add_tab through FormFactory

* Update ProductForm definition and add Tabs

* Add changelog

* Add test to add_tab and get_tabs methods

* Add changelog for @woocommerce/data

* Add tabs to reducer actions and initial state

* Remove unused function

* Fix unit test

* Increment Tabs TypeScript definition

* Add required fields to Tab class and refactor to reduce lines of code

* Change from filter to action in doc example

* Update method documentation

* Add required fields to test

* Change productform_field test

* Fix form-factory unit test

* Update wrong comment
2023-01-25 18:21:41 -03:00
Ron Rennick bf5adf19d2 add changelog 2023-01-25 16:23:01 -04:00
Ron Rennick e2e28fed0b reduce merged internal meta keys to unique list 2023-01-25 16:17:46 -04:00
Barry Hughes a531f83b6d
[HPOS] Add HPOS support for the reserved stock query (#36535) 2023-01-24 18:29:18 -08:00
Corey McKrill 5d59e534da
ReserveStock: Switch to OrderUtil for detecting HPOS usage 2023-01-24 16:02:46 -08:00
louwie17 bcdf2518e6
Refactor product tabs and add product tab slot fills (#36551) 2023-01-24 15:37:21 -08:00
AnnaMag b78318525b
Disable the new navigation in the WC Admin. (#36456)
* Disable the new navigation.

* Add changelog

* Fix linter errors.

* Disable the new_navigation option.'

* Navigation: disable the opt-out modal.

* Disable navigation for sites that have it turned off. Revert obsolete changes.

* Navigation: Add warning before disabling the navigation
in the Feature Settings.

* Linter errors.

* Correct the logic.

* Edit the notice text.

* Fixing linting errors."

* Tests: fix the copy.
2023-01-24 14:05:19 +01:00
Joel Thiessen 4341a53144
Migrating pricing section in product editor to slot fills (#36500)
* Adding changelogs

* Migrating pricing section in product editor to slot fills

* Adding slot and plugarea to variation form

* Removing obsolete pricing section files
2023-01-24 04:24:45 -04:00
Sam Seay 12b8c36408
Add a live branches userscript to WooCommerce Beta Tester (#36523) 2023-01-24 15:44:05 +13:00
Fernando Marichal c030b7dcd5
Add survey when disabling new experience (#36544)
* Add customer-score-tracks data

* Add callback after disabling new exp

* Add TransientNotice after filling out the survey

# Conflicts:
#	plugins/woocommerce/src/Admin/Features/NewProductManagementExperience.php

* Remove comments

* Remove NEW_PRODUCT_MANAGEMENT_FEEDBACK

* Add changelog

* Rename const

* Remove queryParam after showing notice

* Fix lint

* Fix lint 2.0

* Remove empty line

* Refactor `maybe_show_disabled_notice`

* Fix lint 3.0

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2023-01-23 22:43:17 -03:00
Joshua T Flowers 372208be41
Always show comments for product feedback form (#36484)
* Always show comments for product feedback form

* Add changelog entry

* Add CES changelog entry

* Fix up lint errors

* Add default for shouldShowComments in CustomerFeedbackModal
2023-01-23 17:36:48 -08:00
Fernando Marichal db2343cfed
Enable new experience when new user selects "Physical product" (#36406)
* Enable new experience for simple products

* Add changelog

* Fix `updateOptions`

* Fix redirect when new-exp is enabled

* Redirect when new-exp is enabled

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2023-01-23 20:18:43 -03:00
Joshua T Flowers 4a2180f442
Show product CES footer on product tour close (#36516)
* Show product CES footer on product tour close

* Add changelog entry

* Remove unused code
2023-01-23 11:55:35 -08:00
Nathan Silveira 732fd7dba7
Fix typo in product tour in new product management experience (#36561) 2023-01-23 16:23:03 -03:00
Joshua T Flowers 7e27cffdb3
Fix overlapping header elements on product page (#36495)
* Place product tabs beneath header elements

* Observe header height changes and adjust tabs position

* Move header height into reusable hook

* Add changelog entry
2023-01-23 10:14:58 -08:00
Joel Thiessen 447379a424
Migrating product editor inventory section to use slot fills (#36509)
Co-authored-by: Lourens Schep <lourensschep@gmail.com>
2023-01-23 08:11:41 -08:00
Joel Thiessen cb0105efd9
Migrate shipping shipping in product editor to slot fill (#36534)
* Migrate shipping shipping in product editor to slot fill

* Adding changelog

* Removing obsolete shipping section files, adding support to variations form
2023-01-23 10:44:29 -04:00
Luigi Teschio d5a679c3f2
bump WooCommerce blocks package to 9.4.1 (#36553) 2023-01-23 14:09:17 +01:00
louwie17 4ff0aebc56
Update product mvp feature flag (#36552)
* Move product management feature to experimental and add additional note.

* Add changelog

* Remove tooltip

* Fix lint error
2023-01-23 07:43:47 -04:00
Adrian Duffell b87df2fd4a
Add SlotFill for Task List Footer (#36527)
* Add footer slot

* Add ExperimentalWooTaskListFooter slot to task list

* Update inline documentation

* Add changelog
2023-01-23 13:48:42 +08:00
Fernando Marichal 71a7bd4360
Fix/36530 settings tables styles (#36531)
* Fix settings tables

* Add changelog

* Fix lint

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2023-01-21 17:34:02 -03:00
Gan Eng Chin 76d5762400
Add changelog. 2023-01-21 23:24:17 +08:00
Gan Eng Chin d70fb07f31
Modify PluginCardBody to accept className, and change description type. 2023-01-21 23:13:13 +08:00
Gan Eng Chin 6baa403071
Move and rename type Plugin to RecommendedPlugin. 2023-01-21 23:12:04 +08:00
Gan Eng Chin d252922110
Rename file Plugin to InstalledPlugin.
(cherry picked from commit 0229354da0)
2023-01-21 23:11:47 +08:00
Gan Eng Chin 8873252c45
Rename type Plugin to InstalledPlugin.
(cherry picked from commit 56dbf53a35)
2023-01-21 23:11:36 +08:00
Gan Eng Chin 0fe028d8c2
Code refactor with CardHeaderTitle component.
This component will be used in other components later.

(cherry picked from commit 995fb7e02d)
2023-01-21 23:10:31 +08:00
Gan Eng Chin 3f56382cf1
Code refactor with CenteredSpinner.
(cherry picked from commit 5216643465)
2023-01-21 23:09:06 +08:00
Ilyas Foo 30a4bdefd8
Add Tasklist extensibility and WooOnboardingTaskListHeader SlotFill (#36519)
* Add experimental onboarding_tasklist PHP filter

* Add WooOnboardingTaskListHeader and woocommerce_onboarding_task_list_header Slot to task list

* Changelog

* Fix header task logic

* Remove React FC types

* Update changelog

* Fix comment
2023-01-21 15:19:20 +08:00
RJ 39cd780e18
add: slot for tasklist completion component slotfill (#36487)
* add: slot for tasklist completion component slotfill

* added fillprops and changed to experimental slotfill name
2023-01-21 11:05:45 +08:00
Corey McKrill 4b179e1d18
ReserveStock: Modify reserved stock query when HPOS is in use
Ensures reserved stock is correctly counted when HPOS tables are
used and not kept in sync with the posts table.
2023-01-20 18:02:00 -08:00
Corey McKrill bd0d4d6ac7
ReserveStock: Add method to detect if HPOS tables are in use
This method is copied from WC_Customer_Data_Store.
2023-01-20 17:24:41 -08:00
Gan Eng Chin 1af1524b83
Rename CSS installed-channel to registered-channel. 2023-01-21 02:38:00 +08:00
Gan Eng Chin ef669d8ca2
Rename InstalledChannel to RegisteredChannel. 2023-01-21 02:36:39 +08:00
Gan Eng Chin 8754003fb0
Add mapping for sync-failed product listings status. 2023-01-21 02:26:19 +08:00
Gan Eng Chin 2a15f09514
Remove TODO comments. 2023-01-21 02:22:30 +08:00
Gan Eng Chin 3cc568b4ed
Remove duplicated RecommendedChannel type. 2023-01-21 02:20:06 +08:00
Gan Eng Chin 0b1ab21836
Rename types. 2023-01-21 02:14:36 +08:00
Joel Thiessen 67d811a67d
Migrating attributes section in product editor to slot fills (#36483) 2023-01-20 08:56:56 -08:00
Gan Eng Chin a511054a3e
Merge branch 'feature/34903-multichannel-marketing-frontend/main' into feature/34903-multichannel-marketing-frontend/34906-channels-card 2023-01-21 00:10:00 +08:00
RJ 7d8f7ad57c
add: slot for header banner slotfill (#36467) 2023-01-20 22:01:20 +08:00
Nima Karimi da6b4919f8
Multichannel marketing backend and API (#36453)
* Multichannel Marketing - Core Library (#35099)

* Create channel interface and campaign value class

* Create MarketingChannels class

* Register MarketingChannels class in DI container

* Use the new MarketingChannels class to get the installed marketing extensions' data

* Use DI container to access InstalledExtensions class

* Add InstalledExtensions to the $provides array

* Hint that campaign cost should also indicate the currency

* Initialize the channels array

* Add unit tests for MarketingCampaign

* Add unit tests for MarketingChannels

* Add Price class to represent a price with currency

* Use Price class for marketing campaign's cost

* Define a constant to indicate the MCM classes exist

This constant will be checked by third-party extensions before utilizing any of the classes/interfaces defined for this feature.

* Create MarketingSpecs class to include WC.com API calls

* Remove WC.com API calls from Marketing class

And replace them with calls from MarketingSpecs class.

* Use the const from MarketingSpecs

* Fix MarketingChannels unit tests

* Add missing settings URL to the channel data

Co-authored-by: Nima <nima.karimi@automattic.com>

* Multichannel Marketing - Changes to the marketing classes (#36012)

* 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 allows any third-party extension to register as a marketing channel.

* Revert InstalledExtensions

The InstalledExtensions class will be used by the previous generation of the 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

* Translate Exception message

* Remove doc references to a predetermined list of marketing channels

Co-authored-by: Nima <nima.karimi@automattic.com>

* 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>

* Add changelog

* Add product listing status sync failed

Co-authored-by: Nima <nima.karimi@automattic.com>
2023-01-20 14:56:54 +03:00
Luigi Teschio bc6bc8f9b6
Update WooCommerce blocks package to 9.4.0 (#36524)
bump WC Blocks version
2023-01-20 12:01:03 +01:00
Matt Sherman d1bd4f5538
Add permalink_template and generated_slug to products REST API response (#36497)
* Add permalink_template and generated_slug to posts REST API

* Changelog

* Add missing domain for translations

* Use strict comparison for in_array

* Fix code style (alignment) issue

* Update number of expected properties in products schema
2023-01-19 20:28:25 -05:00
Nathan Silveira 1123f9991f
Scroll newly added attribute into view (#36447)
* Scroll newly added attribute into view

* Increment changelog

* Add smooth scrolling when adding new attributes
2023-01-19 19:43:36 -03:00
Néstor Soriano 383c942fa7
Add an admin notice about the upcoming change in PHP requirements (PHP 7.3) (#36444)
* Add an admin notice about the upcoming change in PHP requirements

The minimum required PHP version will be 7.3 as of WooCommerce 7.7.
This adds a dismissable admin notice to PHP 7.2 users.

* Add changelog file

* Disable PHPCS warnings for TODO items (required by GitHub CI)

* Reformat the PHP 7.3 requirement notice to be more translators-friendly

* Add a translators note to pass linting

Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
2023-01-19 13:30:01 -08:00
Moon 395f3b3eb5
Add slot for ProgressHeader and ProgressTitle (#36482)
* Add slot for ProgressTitle

* Add slot for ProgressHeader

* Add changelog

* Add experimental prefix
2023-01-19 13:21:54 -08:00
Barry Hughes a7b1beaa05
Error message in server logs on CSV export error (#34802) 2023-01-19 11:59:12 -08:00
Nathan Silveira 924e64aa48
Add new filter to add additional clauses for SQL statement in Variations report (#36378)
* Apply filter to get additional sql to include variations with no orders

* Add join only when correct option is selected

* Some more desperate tests

* Analytics: use a sepoarate query for data without orders.

* Change 'experimental_woocommerce_analytics_variations_additional_clause' filter to apply sql clauses directly

* Cleanup

* Add changelog

* Fix PHPCS issues

* Add docblock and update the filter name

* Improve docblock of new filter

* Add Since 7.4.0 on filter

* Move union statement before order by statement

* Apply filters before running the db count statement and add sql select clause before

* Remove with sql clause since it's not compatible with MySQL 5.7

* Remove additional spaces

* Fix bug caught by unit test in which $variations_query is overwritten because the assignment was outside the 'else' statement

Co-authored-by: AnnaMag <anna.mag.kedzierska@gmail.com>
2023-01-19 16:19:24 -03:00
barryhughes c42f99048d Linting (clean-up whitespace). 2023-01-19 10:07:39 -08:00
Barry Hughes fe6ab3ea4e
[HPOS] wc_get_order() should use global post/order object if necessary (#36496) 2023-01-19 10:00:38 -08:00
Joel Thiessen 687dd6fdfe
Migrating product editor images section to slot-fill (#36461) 2023-01-19 09:45:30 -08:00
barryhughes f11def132b Improve error logging when file permissions prevent CSV generation. 2023-01-19 09:39:22 -08:00
Gan Eng Chin d69f078fd5
Replace useIsPluginInstalled with useIsPluginInstalledNotActivated. 2023-01-20 01:36:39 +08:00
Gan Eng Chin cd0402a10c
Refetch registered channels after install and activate recommended channels. 2023-01-20 01:02:41 +08:00
Gan Eng Chin 9fa6ea4a25
Display activate button for channels that are not yet activated. 2023-01-20 00:36:34 +08:00
David Marín 7e17a96914
Making function more robust against wrong transients (#34742)
* Making function more robust against wrong transients

* Add changelog

Co-authored-by: Jorge A. Torres <jorge.torres@automattic.com>
2023-01-19 12:34:46 -03:00
Mert Şakar 5cda49f269
Fix issue #34344 - Cannot edit replies to product reviews (#35888)
* Fix issue #34344 - Cannot edit replies to product reviews

* Simplify logic in product review edit screen.

* Add changelog

Co-authored-by: Jorge A. Torres <jorge.torres@automattic.com>
2023-01-19 11:56:11 -03:00
Gan Eng Chin 223ea4d712
Filter recommended channels to get "not installed" or "not activated" channels. 2023-01-19 22:23:00 +08:00
Barry Hughes ece2fb71ce
Update Action Scheduler to 3.5.4. (#36433)
* Update Action Scheduler to 3.5.4.

* Update changelog

Co-authored-by: Jorge A. Torres <jorge.torres@automattic.com>
2023-01-19 09:08:46 -03:00
Gan Eng Chin cf4c62e707
Fix loading bug in useRecommendedChannels. 2023-01-19 19:50:56 +08:00
Gan Eng Chin b708cc18ff
Get recommended channels from API. 2023-01-19 19:33:51 +08:00
Joel Thiessen 2fae3537a7
Experimental SlotContext for managing slot fill interactions (#36333)
* Adding Slotcontext component and adding support to product slot fill components

* Passing inject props correctly to non-function components.
2023-01-19 05:52:45 -04:00
louwie17 fc1745b03b
Add/36075 render fields sections from php config (#36414)
* Add initial component to auto load fills from API config

* Add changelog

* Update logic to make use of new store and re-usable components

* Add changelog

* Add loading state for product form data to add/edit product pages
2023-01-19 04:52:02 -04:00
Florian DANIEL aka Facyla f44e95eda1
Update plugins/woocommerce/includes/export/abstract-wc-csv-batch-exporter.php
use the WooCommerce error log, change the quotation style, and fix a small linting issue (whitespace)

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2023-01-19 08:34:58 +01:00
Chi-Hsuan Huang 025c6aab17
Fix tax task showing as not completed after setting up tax (#36468)
* Wait for requests to finish before redirecting

* Add changelog
2023-01-19 13:01:31 +08:00
Joshua T Flowers c71573d7f9
Update product links when new product management experience is enabled (#36382)
* Replace add new product link with new experience

* Replace add new button on Products page

* Update all edit product links to point to new experience

* Update default add_product value to null

* Add changelog entry

* Fix additional space around equals sign
2023-01-18 15:44:24 -08:00
Lucas Bustamante 49744446a1
Make the selector a bit more strict to avoid collision 2023-01-18 18:56:15 -03:00
Joshua T Flowers 1337a6d36e
Add product tour to new product management experience (#36428)
* Add product tour container and modal

* Fix modal open class name

* Add product tour

* Add changelog entry

* Move product tour state logic into hook

* Fix tour selectors for pricing and actions

* Add tests around product tour container

* Add tests around useProductTour hook

* Make tour responsive

* Use tabs instead of spaces

* Fix more scss lint errors

* Remove extra whitespace
2023-01-18 11:11:02 -08:00
barryhughes 403210185c To fully test a function that uses globals, we need to suppress the global override warning. 2023-01-18 10:29:55 -08:00
barryhughes 764f8d4490 When HPOS is enabled, wc_get_order() should still utilize global post and order objects (if needed). 2023-01-18 10:07:57 -08:00
Barry Hughes 38822cb3e9
Make order updated messages to be compatible with both posts and HPOS (#36485) 2023-01-18 09:37:58 -08:00
Gan Eng Chin 2d7c8db2e5
Map product_listings_status to syncStatus. 2023-01-19 01:32:38 +08:00
nigeljamesstevenson 7cf1599208 update smoke test daily workflow to run api tests first 2023-01-18 17:12:55 +00:00
Gan Eng Chin 0a36d7a4fe
Map errors_count to issueType and issueText. 2023-01-19 01:12:50 +08:00
Albert Juhé Lluveras f3a27839e8
Fix notices styling in Twenty Twenty-Three (#36475)
* Fix TT3 notices CSS identation

* Fix notices styling in Twenty Twenty-Three
2023-01-18 13:51:11 -03:00
Jeremy Lind 17086e05c5
Fix units in function doc comment (#36353)
* Fix units in function doc comment

Typo in doc comments for available unit options.

* Add changelog
2023-01-18 13:38:01 -03:00
Albert Juhé Lluveras 78759685f1
Remove button styles if the block theme has button styles defined in theme.json (#36225)
* Remove button styles if the block theme has their own

* Fix button style in TT2
2023-01-18 13:36:36 -03:00
Gan Eng Chin 07b8b98702
Merge branch 'feature/34903-multichannel-marketing-frontend/main' into feature/34903-multichannel-marketing-frontend/34906-channels-card 2023-01-18 17:35:50 +08:00
Vedanshu Jain 6bc3ad10d6 Changelog 2023-01-18 13:03:56 +05:30
Vedanshu Jain 1c894ff950 Add changelog. 2023-01-18 12:58:40 +05:30
Vedanshu Jain 32cbd6ca40 Make order updated messages to be compatible with both posts and HPOS. 2023-01-18 12:56:59 +05:30
Vedanshu Jain cee68e2543 Remove post_updated_messages filter since the hooks will be expecting post to be set.
We are calling `post_updated_messages` filter when displaying order edit screen in HPOS. However, this is a post based filter, which means that functions hooked to it might be expecting the global $post object to already be set. This unfortunately may cause warnings or fatals, so we remove this filter call from HPOS page.
2023-01-18 12:54:47 +05:30
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