* 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.
* Add help tip to Product galery meta box
* Changelog
* Remove admin_post_thumbnail_html filter from product screen
* Add jQuery to append a tooltip after 'Set product image'
* Add dynamic upload size
* Add guard in case setPostThumbnail doesn't exist
Refactor jQuery code for simplicity
* Run phpcbf
* Fix php linting
* Run lint again
* Make both tooltips with jQuery
Refactor DOM manipulation code
Remove PHP implementation
* Change span tabIndex to 0 to allow focus on screen readers
* Move code to meta-boxes-product
* Add descriptive comment on jQuery code that adds tooltips
* Add @babel/plugin-proposal-class-properties to run storybook
* Add @babel/plugin-proposal-class-properties to webpack config and remove storybook env from babel config
* Add changelog
* Update plugin activation check
This is refactored to test the plugin state instead of checking the API call result.
This is because WordPress can return an error despite the plugin activating correctly. The `unexpected_output` error, in one such case, when WordPress detects stray output upon activation. To workaround this, the plugin is checked for its active status directly.
* Add tests
* Add changelog
* Fix lint issues
* Extract new component 'ProductForm', to reduce duplicated code between add-product-page and edit-product-page
* Add changelog
* Try to merge add-product-page and edit-product-page into a single product-page: running into some issues probably with the controller
* Revert "Try to merge add-product-page and edit-product-page into a single product-page: running into some issues probably with the controller"
This reverts commit bc30b67ef2.
* Fix REST API orders query when HPOS is used
The query wasn't working properly when 'search' or 'parent'
query string arguments were used and HPOS was enabled.
* Add changelog file
* PHPCS fixes.
Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
* Add ability to show CES modal through share Feedback button
* Make use of showCesModal in footer
* Update CES action for share feedback
* Update changes to support second CES question
* Add changelog
* Address some PR feedback
* Add product mvp ces footer
* Add changelog
* Reset action option name after CES action
* Make sure we make use of cesAction
* Add close button
* Fix formatting
* Fix css styling issues
* Add icon to success notice
* Add product mvp CES hook and modify logic a little bit
* Update the CES product action name
* Address PR feedback and fix styling for smaller screens
* Add second question to CES product footer and update options
* Add changelog
* Fix lint error
* Fix tests
Even if these are set to the same value (and so the quantity cannot be changed--which results in a readonly quantity selector) we must output them for compatibility with code (example: Composite Products) that expects them to always be present.
* Update wc-account-functions.php
Correct order of single/plural translation strings to prevent confusion with translations and translators.
* Changelog.
Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
* Fix Protected Directory Admin Notice
- make notice actually close when clicking "Dismiss"
- make unprotected directory detection smarter: not every /woocommerce_uploads/ page with content is a directory listing
* Unwind the change made to method `is_uploads_directory_protected()`.
Discussion here https://github.com/woocommerce/woocommerce/pull/33544/files#r910253861 relates. In essence, we felt it better to have more warnings prompting the user to evaluate if the directory is protected, than fewer warnings with an increased change of not flagging actual problems.
* Add changelog.
Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
* Add updated versions of sr-only and not-sr-only mixins
* Improve element stacking in modals on tablet and mobile
* Add comment suggestion
* Change sr-only for screen-reader-only which is more descriptive
* Record an event 'product_view_product_click' when the 'View Product' link is clicked after creating or updating a product
* Add product_view_product_dismiss tracks events (WIP, not currently working)
* Add changelog
* Fix whitespace in addEventListener and remove console.logs
* Change link tag id to be more specific and comply with CSS guidelines
Move HTML code out of translation function
* Run phpcs in class-wc-admin-post-types
* Add tinyMCE types to add global tinymce variable in typescript code
* Add additional data in getProductData
TODO: I'm not sure if it's possible, or if it makes sense, to include stock_quantity_update in the object
* Add code review suggestions, including:
* Create isElementVisible function to backfill jQuery implementation
* Fix wrong value for is_downloadable, is_virtual, manage_stock
* Fix wrong radix
* Update menu_order implementation
* Add missing ? to weight
* Add stock_quantity_update implementation which is not working as intended
Since the page reloads after product update, the initialStockValue is updated as well
* Remove stock_quantity_update property and adjust is_downloadable, is_virtual, and manage_stock for consistency
* Currency symbol is fixed on the left side of the price input field
* Currency symbol has a different color from the input field value (Gutenberg-700)
* Input value is aligned right
* On focus, we highlight the field's content so the user can quickly clear or overwrite the placeholder text
* On focus, the user can press the up and down arrow keys to increase or decrease the value by 1
* Add changelog
* Remove unnecesary stepUp function
* Add a blank space between the emoji and the message within a notice popup
* Apply comment suggestions
* Remove duplicated text in the snackbar message after publishing a product
* Add support for product attribute taxonomy template
* Add tests
* Add changelog
* Fix format
* Improve changelog
* Add current version to the template
* Add tests for product attribute
* Fix template version
* Fix linting errors
* Refactor tests
* Fix linting errors
* Improve test
* Add comments and fix test
* Fix linting errors
* Fix tests by creating product attribute
* Improve formatting and add return type
* Bump template version to the correct release
* Update product title in smaller viewports
* Move secondary product actions to menu group on mobile
* Hide settings menu on smaller viewports
* Add changelog entry
* Make sure the WooCommerce page hook is untranslated
This works around a WP core bug, and addresses compatibility issues where WC core or 3rd party code expect the pagename or screen ID for one of our submenu pages to remain fixed despite translations.
* Add changelog
* Make PHPCS happy