In our case for the Cart & Checkout feature, we don't want to show the
UI in the "Features" tab in Woo Settings. Creating a flag for this
purpose will make it easier for future features to unsubscribe from
showing a UI if required
Fixes bug introduced in PR #36087 that changes jQuery selectors for quantity input in variable products.
The previous logic is reinstated so that $qty points to the div wrapper, and $qty_input points to the input element inside.
Otherwise, as is in the current version, $qty_input is undefined and the min/max attributes are not updated.
This PR also addresses the original issue #36086 by restricting the selector of the div wrapper to only be the one containing input[name=quantity] (the .qty class filter is also kept to avoid any potential malfunctions of existing code).
* Site Health: Add WC-specific criteria for persistent object cache
WP 6.1 introduces a new test in the Site Health module for whether the
site has an external object cache, and if not, whether it would benefit
from having one. However, the criteria it uses are based largely on
posts and comments. This introduces WooCommerce-specific criteria based
on orders and products. It uses much lower numbers for the
thresholds (100 instead of 1000). These thresholds are somewhat
arbitrary, but reflect that the data objects in a WooCommerce store are
larger and more complex than in a simple blog.
* Add changelog file
* Add additional global attributes and local attributes information when saving product attributes
* Log only local attributes
Add attribute name
Fix issue with attribute_value and names selectors
* Save name and slug for global attributes and global terms
* Product editor: disable the feature in advanced Settings
until we implement the new designs.
* Maintain feature enabled for internal testing.
* Remove obsolete new lines.
* Re-enable the feature flag.
* Disable the new product experience if currently enabled.
* Add changelog
* Remove commented lines, obsolete brackets. Fix conflicts.
* Styling.
* Fix lint
---------
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Remove Klarna payments from North America and remove Amazon pay from CA
* Update payment gateway list ordering priority
* Add changelog
* Sort gateways by recommendation_priority
* Fix DefaultPaymentGateways.php
Fix lint
Fix paypal
Fix comment
* Remove unneed comment
* Change eway priority to show after square
* Include fields date_paid and date_completed to wp_wc_order_stats
TODO: add script to create new columns in the database
* Add update script and new columns in get_schema
* Add new configuration in Analytics > Settings to configure type of date used in Revenue report
* Change date_column_name to date_paid
TODO: This will be configurable in future
* Add date type config field
* Use customizable date field in DataStore
* Change label
* Fix linter errors
* Remove blank line
* Put default column name back to date_created
* Make date_paid and date_completed nullable to help with unit tests
* Remove new table creation in update function and use query method instead of get_var
* Extend stats constructor
* Improve date type configuration description
* Set date column name default to date_created to test if build passes
* Fix phpcs issue on constructor
* Remove cache bypass added by mistake
* Improve changelog
* Fill date_paid and date_completed for refunds to avoid problems whem they are being used to sort
Fix unit tests when date_paid or date_completed are being used as sort date
* Change default to date_created
* Bump update script to 7.5.0
* Add prefix and postmeta variables for script
* Add attribute creation form
* Add changelog
* Check `Used for variations` by default
* Fix lint
* Fix lint
* Fix `create-variable-product.spec` e2e tests
* Fix do not show form with local attributes
* Fix lint
* Fix tests
* Refactor e2e test fix
* Replaced `wp_kses_post` with `esc_html_e`
* Fix lint
---------
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Rather than returning an empty string as the label for an unknown
unit of measure, this allows a merchant to use a custom unit of measure
for something and still have it appear in the UI.
While the extra context would be beneficial for translators, these
particular strings have already been translated for many lanugages
and adding the context would invalidate the translations, which could
cause a visual regression for merchants if the new strings don't get
reapproved before the next version is released.
* Update `config@3.3.7` (from `3.3.3`)
Add it to syncpack, to avoid `ReferenceError: node_env_var_name is not defined` when external extension imports and transforms the `admin-e2e-tests` directly from `node_modules`.
Include https://github.com/node-config/node-config/pull/642
* Make state optional for BG and HU.
* Add changelog.
* PHPCS spacing fix
* Hide State field for Hungary.
* Unhide the State in Hungary.
Some extensions might still use it e.g. for shipping purposes.
* Merge branch 'trunk' into fix/hu-and-bg-state-optional
This PR removes several CSS lines that were enforcing specific styles (mostly padding) to buttons. This is in order to better inherit the styles provided by the theme.
I've noticed on line 339 has an empty array ($attributes) which might be intended to use as a fallback variable for line 345. The array ($attributes) is then extended on line 342, but the variable name at this point is $attribute instead $attributes
* Move attribute data changes out of attribute control
* Move dynamic text to props
* Add onModalOpen callback
* Add onModal close prop
* Add changelog entry
* Use closeModal for edit attribute modal
* Add onEdit callback
* Extract util to get unique attribute id
* Rename editingAttribute to currentAttribute
* Rename showAttributeModal to isNewModalVisible
* Rename AddAttributeModal to NewAttributeModal
* Fix up handle add attributes
* Add onRemove callback for attibutes
* Fix up modal styling classes
* Fix up closing edit modal
* Fix up modal title for options
* Handle PR feedback
* Separate handlers for edit and new modal callbacks
* Update event names to be option/attribute specific
* Use default callback functions
* Handle PR feedback
* pin eslint in .syncpackrc
run `pnpm run sync-dependencies` to ensure pinned version is used across projects, then run `pnpm install` to update `pnpm-lock.yaml`
* add changelog files
ran `pnpm run --no-bail --filter='[HEAD^1]' changelog add --significance=patch --type=dev --entry='Update eslint to 8.32.0 across the monorepo.'`
* re-run `pnpm install` to fix what broke while merging
100 is the maximum limit allowed by the API.
We do this because the API does not return total number of rows, so we use 100 to get "all" rows, to support pagination in the UI.
There's no need to show the two products cells in Status Widget table when stock management is disabled, otherwise you'll get 2 links pointing nowhere (specific report pages are disabled and you'll get an "unauthorized" error)
* Adding contants, renaming files, wiring up shipping section with discrete slots for variants and non-variants
* Refactoring pricing section to give discrete slots for variant and non-variant forms
* Refactoring inventory fills to give discrete slots for variant and non-variant products
* Adding additional slot to pricing -> taxes -> advanced
* Renaming api fields component file
* Refactoring images, details and attributes to match others
* Ensure variant field IDs are distinct, organize all product field fill IDs
* Adding changelog
* Simplifying IDs used for slots
* Minor refactor of pricing taxes class field
* Give api fill exports their own registerPlugin scope
* Refactoring WooProductFieldItem to generate unique IDs
* Adding components changelog
* Add unique sku option to error data when setting product sku
* Add changelog entry
* Add permalink template to the sku error data
* Revert "Add permalink template to the sku error data"
This reverts commit a49ee1d878.
* Fix inappropriate deletion of order from posts with sync off
When the orders table is authoritative and sync is off, deleting
and order should not delete the order record from the posts table,
this commit fixes that.
Additionally, OrdersTableDataStore::delete will now trigger the
woocommerce_delete_order action in all cases, even when the
method is called while the posts table is authoritative.
* Add changelog file
* Fix: order items were not deleted
* Improve comment in the 'delete' method
* Use delete_items instead of a dedicated method for deleting order items
* Move clearQueue call to inside an useEffect
That call was causing a React error (Cannot update a component while rendering a different component)
* Move queueForPage declaration to before it's use
- Use `@include font-size ( 20 )` to generate relative size in rem.
- Use unitless number value for line-height; this is the preferred way according to MDN.
- `font-weight` and `letter-spacing` are not needed.
The UI looks the same before and after this change.
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.
* 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
We intend to use the same namespacing algorithm for HPOS orders cache like we have been using before for posts. Moving this structure to a common trait allow us to use the same logic for both posts and HPOS.
* 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.
* Always show comments for product feedback form
* Add changelog entry
* Add CES changelog entry
* Fix up lint errors
* Add default for shouldShowComments in CustomerFeedbackModal
* 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>
* Migrate shipping shipping in product editor to slot fill
* Adding changelog
* Removing obsolete shipping section files, adding support to variations form
* 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>
* 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
* 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>
* 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>