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