* Handle error for api.delete( coupons/<id> )
* Choose any product that contains "product" in its name
* Expand Pressable test suite
* Add changefile(s) from automation for the following project(s): woocommerce
* Add missing `throw` error
* Make product name more unique with `Date.now()`
---------
Co-authored-by: github-actions <github-actions@github.com>
* Move Pressable and WPCOM to release checks instead of daily checks
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Product filters ensure we can add multiple instances
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Add e2e tests to ensure multiple filters can be added
---------
Co-authored-by: github-actions <github-actions@github.com>
* Update result-count template to display orderby message
* Update result count live region if products are sorted
* Bump result-count template version
* Remove additional full stop.
* Fix docblock spacings
* Remove jQuery code from sort by live region logic
* Validate filter result type
---------
Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
* Skipping 11 tests for the Pressable website
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Jonathan Lane <lanej0@users.noreply.github.com>
* Add aria-label to checkout form landmark
* Remove aria-hidden from checkout form sub-titles
* Add aria-label to checkout form
* Add changelog file
* Remove aria-hidden from form-step snapshots
* Bump form-checkout template version
* Consolidate Store API and Core account creation handling
* Changelog
* Add hook doc
* Update tests to not use global settings
* Ignore lints for other hooks in file
* Wait for response across all requests, including on the checkout page
* Add changefile(s) from automation for the following project(s): woocommerce
* Update Docblock
---------
Co-authored-by: github-actions <github-actions@github.com>
* Make sure the WC Shipping slug is used for installation
* Make sure the check to show banner metabox work for HPOS as well
* Make ShippingLabelBannerDisplayRules::order_has_shippable_products work with HPOS as well
* Remove Jetpack plugin specific checks in ShippingLabelBannerDisplayRules
* Use correct variable names for dotcom connection
* Fix comments
* Remove depenency on WCS&T for showing WC Shipping promo banner
* Remove WC Tax and WC Shipping from incompatible plugins
* Vary action button label if WCS&T is already installed
* Inject config and render label purchase app after activation
* Open the purchase modal after adding it to DOM
* Render Shipment tracking metabox
* Use a different headline when WCS&T is already installed
* Fix UX when a none-compatible WCS&T is already active
* Fix CSS linting issues
* Fix Jslint issues
* Improve around usage of localized variables
* Fix and update JS tests
* Address phpcs issues
* Delete metaboxes of compatible WCS&T
* Remove redundant variable assignment
* Remove css and js of WCS&T if a compatible version is installed
* Fix failing legacy PHPUnit tests
* Only open the new label purchase modal if WCS&T is not active
* Remove redundant code around TOS acceptance for showing the banner
* Remove redundant test for Jetpack version checking
* Make sure target passed to MutationObserver.observe is available
* Add changelog file
* Add openWcsModal to component's prototype
* Add more js unit tests
* Address PHP notice
* Remove redundant variable assignments
* Rename wcsPluginSlug to more clear wcShippingPluginSlug
* Add a link to plugins page if incompatible WCS&T is already installed
* Remove unused function parameters
* Fix API resource path
* Handle a case where none compatible version of WCShipping is installed
* Show product picker control in the editor when a product context is required but not provided
Enhanced the Product Collection block by introducing the `selectedReference` attribute and implementing a product picker control. This control appears in the editor when a product context is required but not provided in the current template/page/post.
1. **block.json**: Added `selectedReference` attribute of type `object`.
2. **constants.ts**: Included `selectedReference` in the `queryContextIncludes` array.
3. **EditorProductPicker.tsx**: Created a new component for selecting products within the editor.
4. **editor.scss**: Added styles for the new Editor Product Picker component.
5. **index.tsx**: Updated logic to determine the component to render, incorporating the new Editor Product Picker.
6. **types.ts**: Defined types for `selectedReference` and updated `ProductCollectionAttributes` interface.
This enhancement allows merchants to manually select a product for collections that require a product context, ensuring the block displays correctly even when the product context is not available in the current template/page/post.
- **Product Picker Control**: Utilizes the existing `ProductControl` component for selecting products. This component is displayed in the editor when a collection requires a product context but it doesn't exist in the current template/page/post.
* Update label on ProductControl component
* Implement dynamic UI state management for product collection block
- Introduced `ProductCollectionUIStatesInEditor` enum to define various UI states for the product collection block.
- Added `getProductCollectionUIStateInEditor` utility function to determine the appropriate UI state based on context.
- Updated `Edit` component to use `getProductCollectionUIStateInEditor` for dynamic state management.
- Refactored `ProductCollectionContent` to utilize the new Editor UI state management.
* Fix: Product picker isn't showing
* Fix: Preview label state isn't showing
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Refactor WooCommerceBlockLocation type
- Introduced specific interfaces for WooCommerceBlockLocation, including ProductLocation, ArchiveLocation, CartLocation, OrderLocation, and SiteLocation, to improve type safety and code clarity.
- Updated createLocationObject function to return a BaseLocation type.
- Refactored useSetPreviewState hook in product-collection utils:
- Extracted termId from location.sourceData for cleaner and more readable code.
- Replaced direct access of location.sourceData?.termId with termId variable.
* Remove fallback to 0 in case there may be a product with id 0
* Use optional chaining to avoid undefined errors
* Rename to
* Change order of arguments in function
* Pass boolean prop instead of making further recognition of the UI state in ProductCollectionContent
* Destructure props in component
* Rename to
* Update names in enum
* Rename to and change the structure to single number.
* Rename location to
* Add a method to choose a product in the product picker in Editor
* Add E2E tests
* Fix failing e2e tests by changing location to productCollectionLocation
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Don't allow selecting product variations
* Minor code refactoring
* Fix: Product control isn't showing products
**Before**
```tsx
const getRenderItemFunc = () => {
if ( renderItem ) {
return renderItem;
} else if ( showVariations ) {
return renderItemWithVariations;
}
return () => null;
};
```
As you can see above, `return () => null;` is returning a function which is causing the issue. This will render nothing in the list. I changed this to `return undefined;`. This way, we will use default render item function.
* Translate text in ProductPicker component
* Improve E2E test
* Use createInterpolateElement to safely render strong HTML tag
* Fix E2E tests
* Fix E2E tests
* Product Collection: Inspector control to change selected product (#50590)
* Add Linked Product Control to Product Collection Block Inspector Controls
- Introduced a new `LinkedProductControl` component in the Product Collection block's Inspector Controls.
- This control allows users to link a specific product to the product collection via a dropdown with a search capability.
- Added corresponding styles to `editor.scss`.
- Integrated a `useGetProduct` hook in the `utils.tsx` to fetch and manage the state of the linked product data, including handling loading states and errors.
- Updated the Inspector Controls to include the new Linked Product Control component, enhancing the block's customization options for users.
* Add E2E tests
* Hide product picker when product context is available
* Improve logic to hide Linked Product Control
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Remove hasError state from useGetProduct hook
* Rename isShowLinkedProductControl to showLinkedProductControl
* Convert jsxProductButton to ProductButton component
* Refactor jsxPopoverContent to LinkedProductPopoverContent component
* Improve UI of Linked Product Control
* Address PR feedback
* Fix E2E tests
---------
Co-authored-by: github-actions <github-actions@github.com>
* Rename isUsesReferencePreviewMode to isUsingReferencePreviewMode
* Change order of conditions in getProductCollectionUIStateInEditor
---------
Co-authored-by: github-actions <github-actions@github.com>
* Revert "Store API: Do not resume orders with `pending` status (#50531)"
This reverts commit 3170acd1b0.
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add products data views list
* Add navigation on the left
* Update edit site package
* Fix styling
* Add changelog
* Add wp/icons package to syncpack exception list
* Delete some unused stuff and address types
* Add changelog
* Remove un needed css
* Remove dependency on edit-site package
* Fix custom status filters
* Make sure page size works with view config
* Remove use of canvasMode and navigation context as it is not needed
* Remove wordpress/dom from syncpack
* Set the regular price when the `Change to:` price is left empty
* Avoid fatal error when price is empty
* Add changefile(s) from automation for the following project(s): woocommerce
* Avoid setting the price to 0 when there wasn't a previous sale
* Move the WC_Tests_Admin_Post_Types test to the appropiate folder so it's run
* Add e2e test
* Add e2e test
* Add changefile(s) from automation for the following project(s): woocommerce
* Add changefile(s) from automation for the following project(s): woocommerce
* Fix lint errors
* Fix lint errors
* Fix test
* Fix lint errors
* Revert mv
* Address increasing sale from 0
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add new prefix and suffix attributes
* Add editable prefix & suffix rich text fields
* Remove the uppercase style from prefix and suffix
* Render the prefix and suffix in the front end
* Fix lint errors
* Handle old sku block without prefix and suffix
* Improve the editor styles
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Use wp_kses_post to filter and format the suffix and perfix
* Address extra space when empty and better escaping
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add i18n_open_product_gallery prop to wc_single_product_params
* Trap focus inside the product gallery modal
* Ensure the product gallery controls are always visible
* Add changelog file
* Add space before parameter
* Early return if there is no elements enough to trap focus
* Revert changes on the gallery trigger link
* Remove unnecessary white sopace
* Fix trap focus when the arrow buttons are hidden
* Remove usage of the Photoswipe destroy event
* Disable PC render when content empty unless no results block is present
* Introduce empty PC classname
* Add E2E test
* Add changelog entry
* Ensure the render is preserved as expected
* Do not render empty div
* Update tests
* Try a different logic
* Add hint to the docblock
* Remove obsolete e2e test
* Update render handler name to acknowledge context
* Fix tests failing due to recent v3 update
* Restore block interactivity
---------
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
* Dismiss "Choose a pattern" if present
* Cover "New in store" for PRessable
* Handle error for `api.delete( coupons/<id> )`
* Check if `Select an option…` is available
* Expand Pressable suite
* Add changefile(s) from automation for the following project(s): woocommerce
* Missed one spec, adding it now
* Handle "Choose a pattern" popup
* Use `closeChoosePatternModal` instead
* Remove comments
* Add missing `throw` error
* Revert to check `Browse store` link, after updating template on Pressable
---------
Co-authored-by: github-actions <github-actions@github.com>
* Ensure stock change notifs only fire when necessary
In #49583 we changed when the actions that trigger stock change
notifications fire, to decouple them from order creation. However, it
turns out what during product creation, the stock quantity update
routines still run even when no stock is being set and even when the
"manage stock" setting is set to false. Rather than try to untangle the
web of why this happens (and potentially break other things in the
process), this simply adds a check for the "manage stock" setting prior
to firing the notif actions, and bail early if the product does not have
managed stock.
It also adds a unit test, which is really more of an integration test,
to ensure this behavior.
Fixes#50958
* Remove irrelevant doc block info
In #49583 we added a second parameter to the
`woocommerce_variation_set_stock` and `woocommerce_product_set_stock`
action hooks, but it was later removed. However, we didn't remove the
corresponding doc block info.
* Add changelog file
---------
Co-authored-by: Naman Malhotra <naman03malhotra@gmail.com>
* Remove filter margins in the editor
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Remove small space after + sign
---------
Co-authored-by: github-actions <github-actions@github.com>
* Align Cart and My Account icons to the right in the Essential Header pattern
* Align navigation icon to the right in the Minimal Header pattern
* Add changelog file
* Don't initialize the block template compatibility classes in classic themes
* Conditionally initialize the block template compatibility classes when the template is being rendered
* Add changelog file
* Remove unnecessary blank line
* Conditionally initialize the block template compatibility classes when the template is being rendered (II)
* Change cursor style of preview button to default
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Hover and active state shouldn't change background color of the preview button.
* Remove use of wp-block-woocommerce-product-collection class
---------
Co-authored-by: github-actions <github-actions@github.com>
* fixes not allowed size parameter for any input types, which do not allow them
* add changelog
* Update plugins/woocommerce/templates/global/quantity-input.php
* Appease linter
---------
Co-authored-by: Lukas Kurzmann <lukas.kurzmann@sunlime.at>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Jorge Torres <jorge.torres@automattic.com>
* Wait for cart response after applying coupons
* Add changefile(s) from automation for the following project(s): woocommerce
* Add changefile(s) from automation for the following project(s): woocommerce
* trigger CI
* Delete plugins/woocommerce/changelog/50995-fix-flaky—cart—oupon-test-50928
---------
Co-authored-by: github-actions <github-actions@github.com>
* Skip - number of introductory patterns not same on Pressable
* Skip - "Want more patterns?" is always present, skipping for now
* Skip - it activates theme through CLI, don't work for Pressable
* Include /customize-store folder for Pressable execution
* Update month formatting
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
* Not show reviews in the frontend when they are disabled at store or product level
* Add tests for single product template
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Fix typo
---------
Co-authored-by: github-actions <github-actions@github.com>
* Restore changes from 48709
* Update the PluginUtil method and related unit test
* Update API endpoint, fix schemas
* Improve unit tests for API controllers
* Fake woopayments gateway is_account_partially_onboarded return false
* Refactor WooCommercePayments class to use get_woo_payments_gateway() function
* Add changefile(s) from automation for the following project(s): woocommerce-beta-tester, woocommerce
* Remove changelog
* Add unit tests
* Update changelog
---------
Co-authored-by: github-actions <github-actions@github.com>