Commit Graph

8867 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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