* 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>
* Customers REST API: return user metadata only when requester has an administrator role
* Add changelog file
Co-authored-by: Nestor Soriano <konamiman@konamiman.com>
* 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
* 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>
* 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
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>
* 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
* 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
* 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.
* 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.
* 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
* 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>
In post storage, just before deleting an order, we will change all child order's parent to be parent of current order. This commit adds the same behavior for HPOS for consistency.
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.
* Fix up updateItem query in CRUD data store
* Add product variation form header
* Fix gaps for variation and parent product actions
* Hide preview button on mobile for product variations
* Add changelog entry
* Add data package changelog entry
* Fix lint errors
* Support passing in filter and new attribute properties to AttributeField
* Changelog
* Pass addButtonLabel as prop
* Add OptionsSection to options tab
* Refactor more to create Attributes and Options fields
* Refactor a couple of things
* Refactor globalAttributeHelperMessage
* Remove `Used for filters` checkbox
* Remove `hydrationComplete`
* Add subtitle to empty state component
* Fix 'Add option' button
* Fix tests
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Truncate attribute option name to a max of 32 chars in variations list
* Use PRODUCT_VARIATION_TITLE_LIMIT to truncate attribute option names
* Fix up lint error
Co-authored-by: Joshua Flowers <joshuatf@gmail.com>
* Convert getCheckboxTracks into generic function because of a type mismatch
* Add image to product variation and export types
* Add single image field
* Integrate SingleImageField in variation details section
* Add changelog file
* Add comment suggestions
* Fix set image onFileUploadChange
* Persist product variation order on product save
* Add batchUpdate to product variations datastore
* Add useVariationOrders hook to manage the ordering logic
* Add local ordering logic to variations field
* Persist variation orders on product save
* Add changelog file
* Add comments suggestions
* Add more comment seggestions
* Add method to get product variation title from data
* Conditionally add variation to page header
* Fix CRUD data store id query on selector
* Make getProductVariation calls and data types consistent to prevent multiple calls
* Add changelog entries
* Update product link type to avoid page refresh
* Expose function to truncate title to 32 character limit
* Add className prop to Sortable
* Add styles
* Add `rows` class
* Add changelogs
* Remove `row-#` class
* Fix min-height
* Set task list item min height
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
The wc_update_721_* functions were not guaranteed to succeed, because of a hardcoded prefix. We also could not depend on the async migration tasks persisting through to the 7.2.2 update.
* Add changelog
* Use the input name when selecting the quantity field.
* Changelog tweak.
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
* Update abstract-wc-order.php
My attempt to make the documentation clearer for these two methods. It's almost impossible to remember all nuances here, so I constantly find myself testing this. Better to have it in the documentation.
* Changelog.
Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
* Add an `required` argument to function `wc_dropdown_variation_attribute_options`
* Whitespace, changelog.
Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
* Add aria-label for simple select dropdown
* Add changelog
* Use placeholder value
* Allow aria label prop and use label as a fallback
* Update test snapshot
* Add changelog
* Use Imagick to set threads instead of putenv() (#31942)
* Adapt code to the coding styles
* Changelog and PHPCS fix.
Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
* Add svg icons and show them in variations list
* The visibility icon should reflect the current visibility status
* Clicking the visibility icon should toggle on or off the variation visibility and persist these settings on refresh
* Price and quantity should be fade when the variant is not visible
* Add changelog
* Hovering the visibility icon should display a tooltip indicating what clicking this button will do
* Fix linter error
* Fix spinner opacity if button is disabled
* Add className support to ListItem
* Refactor to extract AttributeListItem component
* Use AttributeListItem component in AttributeField
* Extract AttributeEmptyState from AttributeField
* Use AttributeEmptyState in AttributeField
* Add default value for label prop on AddAttributeListItem
* Add props for labels in AddAttributeModal
* Add props for labels in EditAttributeModal
* Change the default currency for Croatia to Euros, beginning 2023-01-01.
We do not completely remove the Kuna (HKR) even after the grace period ends (2022-01-15), since an automatic switch to Euros in the storefront, without any sort of conversion, could be challenging for merchants.
* Simplify: we don't need the date-conditional because we are shipping in 7.3 (post-transition).
* Whitespace.
* Update continents test to account for Croatia currency change.
* Further change to API test for continents/currencies.
* Move `*_extra_tablenav` hook, introduce equivalent to `restrict_manage_posts` for parity with CPT order list.
* Changelog.
* Add `since` tag to filter docblocks
Co-authored-by: Jorge A. Torres <jorge.torres@automattic.com>
* Add changelog
* Add pagination to variations list
* Apply styles for pagination paddings and to keep it at the bottom of the section card
* Returning back per page option from 2 to 25
* Fix pagination label text from uppercase to normal and font styles
* Update variation footer gap
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Add pinterest to OBW
# Conflicts:
# plugins/woocommerce/src/Internal/Admin/RemoteFreeExtensions/DefaultFreeExtensions.php
* Switch the alt data
* Add changelog
* Update copy
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.
* Allow `wc_get_order_types()` to return list of order types that have UI
* Make `PageController` register menu items for all order types required
* Make `PageController` URL generation aware of order types
* Make `ListTable` order type aware
* Make `Edit` order type aware
* Add support to `wc_get_page_screen_id()` for order types
* Make `PageController` order type aware
* Include custom order type screens as WC screens
* Make `get_base_page_url()` in `PageController` public
* Make sure Trash links use the correct URL
* Gather request vars in `$request` in list table
* Add some order type specific filters to ListTable
* Fix wrong reference to orders per page in ListTable
* Make ListTable columns work in all screens
* Make PHPCS happy
* Minor PHPCS fix
* Add changelog
* Set page hidden form field based on the order_type (#35751)
* Add ‘woocommerce_order_list_table_extra_tablenav’ hook
* Fix PHPCS warnings
* Make `wc_get_page_screen_id()` datastore aware
* Make `WC_Admin_Assets::is_order_meta_box_screen()` aware of HPOS screen IDs
* Remove unnecessary `$context` arg from `wc_get_page_screen_id()`
* Add support for custom order types to `PostsRedirectionController`
* Make PHPCS happy
* Only connect COT admin page when COT is enabled
* Properly filter out empty status in ListTable
* Fix warning due to uninitialized var
* Do not rely on `wc_orders_count()` for counting orders in `ListTable`
`wc_orders_count()` assumes that order types correspond to a datastore’s object type, which isn’t necessarily the case, producing incorrect results.
Until this is addressed, it’d be best not to rely on it for types other than orders.
* Improve performance for status counts in ListTable
* Fire both order-type specific and generic hook for default column in ListTable
Co-authored-by: bruce aldridge <bruce.aldridge@automattic.com>
* Add exit settings page tracker
* Add exception for when user hits the save button
* Update settings and add icon support
* Add changelog
* Add dismiss track for when user dismisses CES modal
* Add changelog
* Add tests for staticFormDataToObject function
* Fix imports of test file
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.
* Remove CSS that hides the 'Remove' button for product attributes
* Add default placeholder title 'Custom attribute' when user adds a new attribute
* Add changelog
* Add missing esc_html_e
* Try to fix PHPCS
* Add placeholder value for Attribute name input
* Add css and logic to make placeholder title have opacity and remove opacity class after user types the attribute name at the input
* Update placeholder value
* Fix wrong labels
I added e.g. Fabric or Brand to the wrong place.
* Add product variations section
* Add variations list
* Add util to get product stock status
* Add variation specific attribute type
* Add currency code to header column
* Fix up variations header width
* Add variations loading state
* Add changelog entries
* Convert spaces to tabs
* Fix status typo
* Fix up return type for stock status
* Add product form tabs to layout
* Move product sections to respective tabs
* Add tab styling
* Add changelog entry
* Scroll to top on tab change
* Update font weight on active or inactive tabs
* Add blank EOL
* Product import: Remove line breaks in keys
Remove line breaks in keys, to avoid mismatch mapping of keys.
* Fix syntax
* PHPCS
* Changelog.
Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
* Add exit page tracker logic and implement it for product pages
* Add changelog
* Fix lint errors and add comments
* Add ces_location prop
* Add mock to fix broken test
* Add CES exit page survey tests
* Fix a bug with React pages redirects and update actions
* Fix test
* Fix lint
* Add default inside location prop
* Remove exit prefix within action
* Address PR feedback and make sure its not triggered on save
* Update copy of exit feedback notice
* Add changelog
* Update name of param
* Fix lint error
* Use hasFinishedResolution vs isResolved in customerEffortScoreTracks
* Make set_order_props_from_data() protected
This enables 3rd parties that extend the order datastore and need to set their own data. For example, Subscriptions
* Add changelog entry
* return set_order_props_from_data to private visibility
* Make init_order_record and get_order_data_for_ids protected
Following feedback here: https://github.com/woocommerce/woocommerce/pull/35829#issuecomment-1340528244
* Update changelog entry
Co-authored-by: mattallan <matt.allan@automattic.com>
* Fix payment instruction location in on-hold email
* Update template version tags.
* Changelog.
* Update version tag to 7.3.0.
* Update version tag to 7.3.0.
Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
* Make linter happy by (very painfully) introducing Yoda conditions.
* Change how the COT related tools work combined with the COT feature.
- Enabling the feature will now automatically create the tables
if they don't exist already.
- In fact, enabling the feature is now the only way to create the tables.
- The "Delete tables" tool will be shown as disabled in the feature
is enabled.
* Add changelog file
* Fix code sniffer issues
Do not try to query for orders by type, if no order types are registered.
If DataSynchronizer::get_current_orders_pending_sync_count() is called very early in the request then order types may not yet have been registered. This can for example happen during plugin activation/installation.