Adds `filter_empty` parameter, so that customer records with specific empty fields can be left out of the results, resulting in more efficient requests.
Fixes#38820
Even if errors are found when populating the order properties, the order object will be returned anyway. Additionally, these errors will be logged as warnings, both when using the new HPOS-based orders datastore and when using the old CPT based datastore.
* Use NumberUtil::round() instead of number_format() in WC_Order::get_item_subtotal()
* Add changelog
---------
Co-authored-by: Jorge A. Torres <jorge@0xbad.com>
* Add product id to product data
* Create a React Hook for updating product slug
* Update product slug when title is updated.
* Add changelog
* Import hooks from index
* Use getPostId util to get product ID
* Only update draft product's slug
* Revert "Always show pricing group fields, disable if not available for a product type (#38531)"
This reverts commit 18f2de2bc4.
* Add changelog and fix lint issues
* Remove call to removed function
* Add new countries in isWCPaySupported
* Add new countries in get_wcpay_countries
* Add new countries in default free extension 'woocommerce-payments'
* changelog
* fox linting issue
* Remove support for Czech Republic, Sweden, Hungary
* Revert "Remove support for Czech Republic, Sweden, Hungary"
This reverts commit 0a8309f664.
* When ExtendedContainer::replace is used and an instance of an object is passed as the replacement, the init method of the passed object will be executed (previously the container would execute init only when creating a new instance from a class name).
* Added the ExtendedContainer::reset_replacement method, this will undo a replace and reset the registration back to its original state (so get will act as if replace had never been executed for the given class name). Note that for shared definitions this needs to be combined with reset_all_resolved.
* Similarly, added the ExtendedContainer::reset_all_replacements method.
* Add possibility to track select and checkbox values for non_option settings
* Track select and checkboxes in abstract-wc-settings-api
* Add changelog
* Add hook comment and ignore phpcs for actions that were already called before
With orders table authoritative, sync disabled, an order with refunds
is deleted, a duplicate deletion record was being created for the refund.
That's because 'upshift_or_delete_child_orders' was deleting the child
orders, which caused a deletion record to be already created; and
after that, 'handle_order_deletion_with_sync_disabled' was again
creating a record for these child orders.
The fix is a bit convoluted because we can't know for sure if
'upshift_or_delete_child_orders' will delete the child orders or not.
* Fix overlapping button position when the height is less than 667px (iphone SE)
* Fix misaligned check icon on mobile
* Prevent the menu from closing when clicking on a selected item
* Add changelog
* Fix lint
---------
Co-authored-by: moon <moon.kyong@automattic.com>
* Remove feature related query args after enabling/disabling it
* Test to see if E2E tests pass
* Revert "Test to see if E2E tests pass"
This reverts commit 120e971f33f22dc3e7eec6e5ab228b1908c56364.
* Add support to remove multiple query params
* Add wc_get_default_product_type_options function
* Use wc_get_default_product_type_options() as initial input for product_type_options filter
* Changelog
* Only record product update on already published products
* Add source into published product tracks event
* Add missing tracks options to product update event
* Track tab clicks in the editor
* Add source to tab clicks
* Record tracks on preview click
* Add events for media gallery, description, and attributes
* Add tracks events to more menu
* Replace new_product_page with source
* Add changelog entry
* Fix lint errors
* Add tracks for About the Editor menu item
* Add onClick event to AboutTheEditor menu item
* Use dropdown option event for classic editor menu click
- When ExtendedContainer::replace is used passing an instance of
an object, the 'init' method will be executed in the instance
when resolving the replaced class name.
- Added the ExtendedContainer::reset_replacement method, this will
undo a 'replace' and reset the registration back to its original state.
- Similarly, added the ExtendedContainer::reset_all_replacements method.
This makes the behavior of wc_get_order to be the same as when HPOS
is disabled (and Abstract_WC_Order_Data_Store_CPT is thus used
instead): the order is still retrieved (although without the errored
properties set) instead of the function just returning false.
An example of when this can happen is if an order refund has the id
of a no longer existing order as the parent id.
* get_index_columns using SHOW INDEX FROM query instead of information_schema
* returning empty array for clarity
* ignore interpolated query
* adding changelog entry
* Adding unit tests for the updated DatabaseUtil::get_index_columns()
---------
Co-authored-by: Michael Pretty <prettyboymp@Michaels-MacBook-Pro.local>
* Disable 'Used for variations' checkbox when product type is not variable and remove leftover code
* Run disable or enable fields after saving attributes
* Update orders status query to ensure it exclude trash.
* Add incentive ID to every track event
on the welcome incentive page.
* Remove unnecessary SCSS after #38775 fix
* Add changelog entry
* Replace tos_url with tc_url for accurate naming
* Fix phpcs errors
---------
Co-authored-by: Vlad Olaru <vlad@pixelgrade.com>
* Enable core-profiler in prod
* Add Changelog
* Skip StoreDetails tests -- we're replacing it with Core Profiler
* Add features.is_enablefd to detect features
* Skip the onboarding wizard tests when the core profiler is enabled
* Skip skipping the onboarding wizard when the core profielr is enabled
* Incldue features module
* Skip core profiler for testing
* Skip core profiler for testing
* Remove test code
* Skip teh plugin page when all the plugins are activated
* Fix the if statement so that stageIndex becomes 2 when progress is over 60
* Add a 2nd loader stage for the skipped guided setup
* Add changelog
* Lint fix -- css
* fix: banished core profiler page spinners
* addressed pr comments
* update jest snapshot
---------
Co-authored-by: rjchow <me@rjchow.com>
* Use theme color for the option hover
* Add Changelog
* Remvoe absolute position -- can't predict correct value for bottom
* Fix css lint error
* Fix button width
* Use gray-0 for dropdown item hover color
* Fix border style for Give your store a name field
* Fix hover color for the platform options
* Remove light color on hover
---------
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
* Fix font heading font style and adjust main component max width to match design
* Remove redundant #FunWooFact
* Reset button font color to follow admin theme
* Fix Installed label vertical alignment
* Changelog
* Remove permanent borders from consent checkbox, lint fix
* Remove box shadow on checkboxes in plugins page
* Standardize checkbox styling across core profiler
* Fix heading font styling
* Lint
* More lint
* Update snapshot
Squashed commit of the following:
commit 8ccd8e26127594e859b37ead9fd150f05d36d9f5
Author: barryhughes <3594411+barryhughes@users.noreply.github.com>
Date: Mon Jun 5 19:37:57 2023 -0700
Do not output payment gateway nonce to unqualified users.
commit 882946bb18dee5eb7ffea48ddfbd4c14a5092c94
Author: barryhughes <3594411+barryhughes@users.noreply.github.com>
Date: Wed Jun 7 14:24:58 2023 -0700
Instead of looking for `?wc-ajax`, specifically exempt `admin-ajax.php`.
This mimics the existing approach used for `admin-post.php` requests, and is stricter by default.
commit 99cffd7cde1aa87176254845c732c91a446232f7
Author: barryhughes <3594411+barryhughes@users.noreply.github.com>
Date: Tue Jun 6 12:40:21 2023 -0700
Nonce verification not needed when evaluating ajax properties.
commit 99157d2a18ea78c68c265609dfdd1bddadeee7b2
Author: barryhughes <3594411+barryhughes@users.noreply.github.com>
Date: Tue Jun 6 12:38:53 2023 -0700
Document `woocommerce_disable_admin_bar` hook.
commit badcf8f50099dd38fa855d2aa71c8507d3f2a252
Author: barryhughes <3594411+barryhughes@users.noreply.github.com>
Date: Mon Jun 5 18:49:25 2023 -0700
Describe expectations around customer access to the dashboard.
commit 127053e1c27e7da5515c6638859fa09384241624
Author: barryhughes <3594411+barryhughes@users.noreply.github.com>
Date: Mon Jun 5 13:30:03 2023 -0700
'wc-ajax' requests should be filtered out of admin access logic.
commit 2e8182761e050cc4371181eaa197b6d4b2867f89
Author: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
Date: Fri May 12 15:15:57 2023 +0530
Clean up individual escape to also do it again when it is used.
* Initial refactor of components
Move out from index every UI component to make it easier to maintain.
* Initial implementation of new design
Some minor adjustments are missing, and I've added a few TODOs to complete later.
* Add changelog entry
* Finish design update
* Compress menu icon
* Add user's first name to heading copy
* Fetch and cache eligible incentive from WCPay API
Sharing its properties under `window.WcSettings.admin`
* Filter `allowed_promo_notes`
To be able to add those form WCPay API request
* Update JS side to use the new shared incentive details
* Ensure we cache requests even if there are no eligible incentives
* Fix a typo in WCPayBanner
* Move incentive preloaded data from wcSettings
to a new window variable which will be only loaded on WCPay welcome page.
* Simplify `has_wcpay` check
* Render sanitized HTML from incentive description
* Update get incentive logic to also cache non success responses
* Add incentive ID to page view track
* Add changelog entry for the onboarding package
* Update used options names
and add them to `get_default_option_permissions
* Differentiate every dismissed incentive
Reuse WCPay welcome page logic for notes display conditions
* Use tos_url instead of tos_link to match response
* Fix incentives endpoint request payload
* Back to preload incentive on admin shared settings
* Move promo notes filter to where it's used
to avoid any possible race conditions.
* Replace every occurrence of `WooCommerce Payments` with `WooPayments`
* Prevent modal large padding-bottom
* Prevent another global style override on modal
* Fix TS error coming from trunk merge
* Fix wrong style property
* Further restrict WCPay incentives to plugin not active and countries supported
* Adjust the meaning of has_wcpay
* Wait for dismiss option update before redirect
to prevent the side menu entry to be visible after redirecting back to WC admin.
* Enforce TOS asterix at the end of incentive description
* Remove underscore from priavate instance var.
* Fix ESLint error
* Fix SCSS linting issues
* Refine `has_wcpay` and `has_orders`
* Enforce consistent WooPayments branding
* Enforce stricter i18n calls with escape
* Update page title to match new branding
* docs: Enforce branding in code docs also
* Remove method that is unreliable to be used outside of onboarding
* Remove unused constant
* Missing new line
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
---------
Co-authored-by: Vlad Olaru <vlad@pixelgrade.com>
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
* Return full response from getJetpackAuth
* Add success and errors
* Redirect to Home in case of an error from getJetpackAuth endpoint
* Add changelog
* Use redirectToJetpackAuthPage
* Replace window.location.href with navigateTo
* Fix type issue with getJetpackAuthUrl
* Update plugins/woocommerce-admin/client/core-profiler/index.tsx
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
---------
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
* Add install-and-activate-plugins-async action to onboarding
* Add label and learn_more_link types
* Use label and learn_more_link
* Remove unused imports
* ts fixes
* Visual changes on the plugin page
* Change CTA font size from 13px to 14px
* Change spacing between the chebox and logo to 24px
* Change heading font-weight to 500
* Fix css lint error
* Add back learn more link that was removed from rebase
* Add required packages
* Load Jetpack Config
* Add getJetpackAuthUrl to data/onboarding
* Add Connection Rest Auth -- seems like this is required for Jetpack to communicate back to the connected site
* Add jetpack-authorization-url REST API
* Redirect to Jetpack Auth page after the installatino process if jetpack was selected
* Require can_install_plugins permission for jetpack auth url endpoint
* Update packages/js/data/src/onboarding/resolvers.ts
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
* Update plugins/woocommerce/src/Admin/API/OnboardingPlugins.php
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
* Remove automattic/jetpack-sync and its config
* Support redirect_url and from params
* Do not redirect to Jetpack auth if it is already connected
* Add installed_ext_success=1
* Use woocommerce-core-profiler for from value
* Revert unrelated lock file changes
* Minor refactor
* Extracted out isJetpackConnected cond to a guard
* Added meta data for isJetpackConnected to prevent unwanted spinner
* Add Changelog
* Lint fix
* Move Jetpack Connection config init to class-woocommerce
* Add changelog
* Remove unnecessary require
* Note jetpack-authorization-url endpoint is experimental
* Fix broken test
* Add component to sendToJetPackAuthPage state
* Fix lint error
---------
Co-authored-by: rjchow <me@rjchow.com>
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
Actions starting with “mark_” were silently handled by our own code, preventing 3rd parties from adding their own “mark_” bulk actions and acting on them.
* Configure the expiriment to redirect variation treatment to the new product editor
* Add changelog file
* Fix experiment name
* Fix changelog description
* Options menu in product editor view should show Turn off the new product editor with some subtext
* Record event product_editor_options_turn_off_editor_click when clicking Turn off the new product form menu item
* Add changelog file
* Add 'About the Editor' menu item
* Show the guide when clicking the menu item
* Add track event when clicking about the editor
* Add changelog
* Remove from product more menu
Adds the following pnpm commands for utilizing the new phpcs-changed
composer scripts (see #37465 and #38085):
- `pnpm --filter=woocommerce run lint:php:changes`
- `pnpm --filter=woocommerce run lint:php:changes:staged`
- `pnpm --filter=woocommerce run lint:php:changes:branch`
Also updates the contributing guidelines to make these commands more
discoverable.
* Use WooFooterItem for Footer
* Use WooFooterItem fill for TransientNotices
* Adjust TransientNotices styling to work in footer
* Fix footer width when in setup wizard
* Change export of TransientNotices from default to named
* Add border to footer
* Changelog
* Changelog
* Mock WooFooterItem to allow unit tests to pass
* Fix lint error in test
* Adds a data key with the list of WC features that are currently enabled on the site.
* Adds a feature_compat key to each plugin that shows its compatibility with each feature (compatible, incompatible, or uncertain) if the plugin is "WooCommerce aware", otherwise just an empty array.
This PR fixes two unit test files that could not be run individually by adding HPOSToggleTrait.php to the unit test boot loader. It also does a bit of namespace cleanup in HPOSToggleTrait.php.
The mocks in this test were affecting other unit tests for the
PluginUtil class, but only when run in GitHub actions (the tests were
working fine locally). Rather than hold up this PR, I've created
issue #38720 as a future task to add the unit test back in once we've
figured out if there's something buggy happening with dependency
injection.
* Add support for new properties "added" and "deleted" in settings tracking
* Add calls to actions when adding and deleting shipping zones and classes
* Add changelog
* Cover an edge case where the zone is created through adding a method and add more comments
* Fix lint issues
* Add inline comment explaining if statement
Refactor WC_Settings_Tracking to work with a single action with an additional parameter
We were checking whether an order is modified before migrating them. While on surface this looks good, the logic itself has following flaws:
1. We were only checking the columns in the core posts table, but none of the meta fields.
2. Our comparison logic was written in SQL, but given that we have a much better comparison logic already written in PHP, it does not makes sense to maintain two different versions.
3. We are alrady checking for modified records in the batch processor itself, so another check this close to migration logic is not really needed.
* Change Skip this setup to Skip this step
* Visual changes on intro, user profile, and skip guided page
* Always check tracking agreement
* Change border to 2px
* Change Give yoru store a name font-size to 13
* Add Changelog
* Update test to reflect the text change
* Remove !important
* Update test snapshot
* Update test snapshot
* Remove test that is no longer necessary
* Add install-and-activate-plugins-async action to onboarding
* Add label and learn_more_link types
* Use label and learn_more_link
* Fix type
* Add changelog
* Add changelog
* Add install_priority -- this will be used in the core profiler
* Sort selected plugins by install_priority for installation
* Remove unused imports
* dev: refactor installAndActivatePlugins to xstate
* ts fixes
* Sort plugins by install_priority
* Make sure WooCommerce Shipping is always visible
* Update free extension list content
* Updated WC payment description
* Updated logo images
* Visual changes on the plugin page
* Change CTA font size from 13px to 14px
* Change spacing between the chebox and logo to 24px
* Change heading font-weight to 500
* Fix css lint error
* Fix gray-900 variable name
* Hide learn more link on mobile view
* Add back learn more link that was removed from rebase
* Send pluginsAvailable to pluginInstallermachine
* Use is_activated to determine plugin availability and install status
* Update packages/js/data/src/onboarding/types.ts
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
* Update plugins/woocommerce/src/Internal/Admin/RemoteFreeExtensions/DefaultFreeExtensions.php
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
* Add back recordTracksPluginsLearnMoreLinkClicked
* Use install-and-activate-plugins-async when timer is up
* Record plugin and link with learn more linked clicked event
* Fix failign tests
* Add comment for install_priority
---------
Co-authored-by: rjchow <me@rjchow.com>
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
* Ensure order ordering in order filter unit test
* remove unused variable, fix spacing
---------
Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
* Copy Guide component from @wordpress/components and fix focus issue
* Add 'tell me more' button and behavior
* Move Guide component from components package to admin package
Implement assigning an href to the finish button, sending the current page and origin as a parameter on the onFinish callback
* Remove dependency
* Restore pnpm-lock.yaml
* Add changelog
* Add comment in Guide component
* Dismiss modal only when it's finished or X button is clicked
* Add 'rel' when opening link in a new tab
* Always show General product tab
* Add info messages for variable and grouped products
* Add logic to disable/enable fields and labels based on product type
* Tweak CSS and fix links
* Add tracks events for links
* Add filters to pricing disabled message
* Tweak logic to only enable fields on certain product types instead of disabling in the opposite ones
Add fallback message when pricing is disabled but it's not Variable or Grouped product
* Add docblocks
* Fix more lint issues
* Fix last lint issues
* Update selector in e2e test
* Refactor PHP echo
* Attach to #woocommerce-product-data instead of attaching to body
* Adds a data key with the list of WC features that are currently
enabled on the site.
* Adds a `feature_compat` key to each plugin that shows its
compatibility with each feature (compatibile, incompatible, uncertain)
if the plugin is "woocommerce aware", otherwise just an empty array.
* Changes the feature given it's id and a toggle value as a query param
* Swap classic editor and new product block editor url when product_block_editor feature changes
* Turn off the product_block_editor feature when user choose to use the classic editor
* Add changelog files
* Fix linter errors
* Add nonce to each feature change request
* Change the hooks name for better readability
* Use get_current_screen function to better identify if the current screen is the product creation or edition
* Add wp_die if the nonce verification failed
* Change regex for explode/parse_url for better reading
* dev: refactor installAndActivatePlugins to xstate
* ts fixes
* fixed first plugin install progress bar reset issue
* clean up todo comments
* fixed bug where errors were not reported if past 30s timeout
* fix lint
Co-authored-by: Joel Thiessen <444632+joelclimbsthings@users.noreply.github.com>
Co-authored-by: Nima Karimi <73110514+nima-karimi@users.noreply.github.com>
Co-authored-by: Thomas Shellberg <tommy.shellberg@automattic.com>