* Add new `Product listing with gallery` pattern
* Replace single product block pattern
* Remove ids
* Fix title and images
* Rebuild the image gallery to make it work on diff widths
* Fix image src
* Fix gallery image and align description
* Update Mini-Cart block editor sidebar
* Rename Mini Cart block to Mini-Cart
* Update Mini-Cart block editor sidebar (II)
* Update two instances of mini-cart to uppercase
* Adapt the Add to Cart Button block to be registered via block.json
* Remove the legacy supports.ts file
* Ditch all registration methods from the ProductButton class as it is now registered via metadata (a block.json file)
* Update get_block_type_uses_context and register_block_type_assets
* Only validate postcode if its required
* Clear postcode validation error if postcode is not required
---------
Co-authored-by: Niels Lange <info@nielslange.de>
Implements the ProductSelector advanced filter within the “Products (Beta)” block.
The filter allows the merchant to narrow down the exact products to which all
subsequent filters will be applied, mirroring the functionality of the existing
“Hand-picked Products” plus all the other functionalities available
from the “Products (Beta)” block.
* Empty commit for release pull request
* Add 10.0.3 changelog
* Update versions to 10.0.3
* Fix image editor in Featured Product/Category blocks on WP 6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/9142)
* Add 10.0.3 testing steps
* Empty commit for release pull request
* Check that the customized fallback template is archive-product before unsetting the source property (https://github.com/woocommerce/woocommerce-blocks/pull/9330)
* use 'enqueue_block_assets' is available (https://github.com/woocommerce/woocommerce-blocks/pull/9332)
* Remove esc_url() on self generated link to edit the Mini Cart template since it gets escaped in JS (https://github.com/woocommerce/woocommerce-blocks/pull/9348)
* Add changelog entries to readme.txt
* Update version number in several files
* Add testing notes for the release
* Add woocommerce/woocommerce-blocks#9332 to testing notes
* Add testing on frontend for woocommerce/woocommerce-blocks#9332
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
The plugin's readme.txt file had a URL to the official documentation but
there was no hyperlink - only text.
This improves the page by removing the text link and hyperlinking the
"official documentation" text itself.
* Add pattern for split hero product banner.
This adds a new pattern for a hero product banner with a 50/50 split,
heading and CTA on left and product image on right.
Uses the Media + Text block.
* Update image to use Unsplash placeholder.
* Remove WooCommerce prefix in pattern title.
* Remove unneeded wrapper group block.
* Serve placeholder image from plugin directory.
* Preserve email when rendering shipping address form for the first time
* Ensure billing email does not reset when changing form values
* Add test to ensure email does not get overwritten
* Ensure the product title is correct when used outside of the scope of the single product template.
* Update docblock with the details about the temporary workaround.
* Move notice to top and only show on cart page
* Missing setting on cart page prevents notice display
* Allow null in the select-shipping-rate endpoint to select all packages
* Only show the warning if different packages are selected
* Check if selected rates is an object before mapping it
---------
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
* Remove min-height and padding for WP Button elements
* Remove commented out code
* Add min-height style back in for .woocommerce-block-theme-has-button-styles themes
* Fixed store api documentation for min_price and max_price
* Update products.md
* Update products.md
* Update src/StoreApi/docs/products.md
Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
---------
Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
* Using nested selector to style Product elements in Products Block
This commit simplifies the INNER_BLOCKS_TEMPLATE array in the product-query constants.ts file by removing the style properties from the individual elements. Instead, the default styles are now managed in the style.scss file, providing a more consistent and centralized approach to styling.
In the style.scss file, a new section for default styling has been added to handle product elements inside the Products Block, adhering to the Gutenberg styling hierarchy. This ensures the lowest precedence in the hierarchy, allowing for easier overrides when needed.
* Decrease specificity of styles for product elements in Products Block
The commit changes the default styles for product elements inside the 'Products Block'. It changes the way the margin-bottom and margin-top properties are set by using the :where() selector instead of using the .products-block-post-template class selector. This is done to decrease the specificity of the CSS selector, ensuring that the styles have the lowest precedence in the hierarchy. It also removes the display: inline-block property from the a selector, and moves the styles to the .editor-styles-wrapper class selector.
* Decrease specificity of CSS selectors
In these changes, the product elements inside the Products Block have been restyled. The specificity of the CSS selector has been decreased using the :where() selector, to ensure that these styles have the lowest precedence in the hierarchy.
In constants.ts, a new class name, products-block-post-template, has been added to the inner block template for the post. This class is used to add default styles for inner blocks.
In style.scss, the CSS selector for the inner blocks has been updated to include the new class name. The :where() selector has also been used to ensure that these styles have the lowest precedence in the hierarchy.
* Update default margins and remove redundant entries
This commit updates the default margin values for the Product Title in the Products block, moving them from the style.scss file to the constants.ts file. It also removes unnecessary empty arrays in the INNER_BLOCKS_TEMPLATE and background-color property from the style.scss file.
* Add align support to single product block
* Fix block alignment that was not being set on the frontend
* Remove classname prop from the Single Product Edit component
* Add new `Header Centered Search` pattern
* Add margin support to the customer account block
* Add margin to the customer account to separate it from the search bar
* Update margin
* Add with, fix margins
* Remove unnecessary separator
* Updates after review
* Remove ref
* Remove separator
* Bring back separator and use product search
* Remove html block and fix search border
* Add new `Footer with 3 menus` menu
* Stack menus on mobile, remove refs
* Change the site title to a `p` tag
* Align menus to the top and add paddings
* Make the `powered by` string translatable and add padding
* Improve search
* Add late escaping to call in MiniCart.
* Add escaping to call in AssetsController.
* Add escaping to calls in StoreAPI pagination utils.
* Add ignore line to file require - OK.
* Minor update to grammar in code comment.
* Mini Cart Contents block: set minimum width
* Mini Cart Contents block: allow changing the width only in the feature plugin
* Allow resetting the Mini Cart Contents width to the default
* Update assets/js/blocks/mini-cart/mini-cart-contents/edit.tsx
Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
---------
Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
* Add new pattern
* Style improvements after review
* Fix price on mobile and image thumbnail
* Remove columns for title and price
* Review improvements
* Use shop url
* Make the product title bold
* Add class property to track local pickup enabled
* Force shipping enabled only when local pickup is also enabled
Otherwise, skip filtering and leave it to the current value
* Disabled and add text to WC Core hide shipping option
* Skip forcing shipping to be enabled in all cases
* Remove WC Core setting changes for hidden shipping rates option
* Add warning to local pickup UI about hidden rates setting in core
* Add local_pickup_enabled util function
* Revert "Skip forcing shipping to be enabled in all cases"
This reverts commit 0bf1886e73d791f7828ac86988f681cdce808b12.
* Check if local pickup is enabled before force enabling shipping
* Show correct shipping placeholder if rates hidden until address entered
* Remove tests for removed functionality
* Remove shippingCostRequiresAddress prop
* Update tests for shipping settings
* Remove irrelevant tests and fix existing ones
* Fix typo in comment
* Disable local pickup after each test
* Get shipping data from useCustomerData hook
* Change div in help prop to span
This prevents a DOM Nesting error, div cannot appear as a descendant of p
* Prevent hide shipping notice showing if the setting was originally off
* Use body background color as the Cart block sticky footer background color
* Reduce the opacity of box-shadow.
* Fix the Proceed to Checkout button cut off.
* Fix - "Order received" page does not display the payment method information.
* changed fix approach by explicitly set payment method title.
---------
Co-authored-by: Niels Lange <info@nielslange.de>
* Wait until networkidle before running tests
* Copy logic to select first attribute from PHP classic template tests
* Create util function to insertProductByAttributeBlockWithFirstAttribute
* Fix infinite loop (range error) on subscribe callback.
* Replace getEditedPostContext with getEditedPostId to retrieve the templateId from the Site Editor for 6.1.1 compatibility
---------
Co-authored-by: tjcafferkey <tjcafferkey@gmail.com>
* Don't use withProductDataContext in Sale Badge block
There was no information about product passed to the block, so it fetched information about all products which then wasn't even used
* Pass necessary props to the Sale Badge so it doesn't overfetch unnecessary data
* Move the import to the previous place
* Single Product Template - Compatibility Layer: don't skip custom HTML (https://github.com/woocommerce/woocommerce-blocks/pull/9075)
* Fix: tax_query should be calculated only if __woocommerceAttributes is valid (https://github.com/woocommerce/woocommerce-blocks/pull/9049)
This commit refactors the update_rest_query method in the ProductQuery.php file to improve code readability. It simplifies conditional expressions by introducing variables for clarity, and uses ternary operators to streamline the logic.
* Blockfied Single Product Template: Add support for template for specific product (https://github.com/woocommerce/woocommerce-blocks/pull/9069)
* Product Price Block: remove ProductSelector (https://github.com/woocommerce/woocommerce-blocks/pull/8980)
* Empty commit for release pull request
* Make Woo_Directive_Store PHP 7.3 compatible (https://github.com/woocommerce/woocommerce-blocks/pull/9033)
* update version
* add changelog
* add testing instructions
* update zip link file testing
* Update docs/internal-developers/testing/releases/1001.md
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
---------
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Add color, typography, and spacing support to Product SKU block
This commit introduces a new file `supports.ts` for the Product SKU block in the WooCommerce Blocks plugin, which adds color, typography, and spacing support. The following configuration has been added:
1. In `assets/js/atomic/blocks/product-elements/sku/supports.ts`, a new `supports` object is created, which extends the shared configuration and adds support for the following properties:
- `text` and `background` color
- `fontSize`, `lineHeight`, `__experimentalFontWeight`, `__experimentalFontFamily`, `__experimentalFontStyle`, `__experimentalTextTransform`, `__experimentalTextDecoration`, and `__experimentalLetterSpacing` for typography
- `margin` and `padding` for spacing
* Add color, typography, and spacing support for Product SKU block in All Products block
This commit extends the support for color, typography, and spacing to the Product SKU block when used within the All Products block. The following changes have been made:
1. In `assets/js/atomic/blocks/product-elements/sku/block.tsx`, the `useColorProps`, `useSpacingProps`, and `useTypographyProps` hooks are imported and used to add the appropriate className and style properties to the rendered SKU element.
2. In `assets/js/atomic/blocks/product-elements/sku/edit.tsx`, the `style` property is separated from `useBlockProps()` and used directly on the `div` element for the SKU block.
* Add server-side rendering class for Product SKU Gutenberg block
This commit adds the ".wp-block-woocommerce-product-sku" class to the Product SKU Gutenberg block for server-side rendering purposes. The inclusion of this class ensures consistent styling between the editor and the front-end view of the block, providing a seamless experience for users.
The class name is generated based on the Gutenberg block prefix "wp-block", the namespace "woocommerce", and the block name "product-sku", creating a unique and identifiable class for the block. This class enables developers to target the block specifically in both the editor and front-end styles, maintaining the integrity of the block's appearance and functionality across different environments.
By adding this class to the server-side rendered version of the block, we ensure a unified and coherent styling experience throughout the block's usage.
* Fix minor issues
* Gate only experimental features behind isFeaturePluginBuild flag
This commit refactors the Product SKU block supports to enable color, typography, and spacing features for all builds, while keeping experimental features specific to the feature plugin build. It also adds necessary lint and TypeScript error handling for the experimental spacing API.
* Add overflow-wrap to Product SKU block and update comment
This commit adds the overflow-wrap property to the Product SKU block styles to handle long SKU values gracefully.
It also updates the comment for the experimental spacing API to better reflect the usage check.
* Refactor Product SKU block classname and style handling
This commit refactors the Product SKU block classname and style handling. It combines classnames for better readability and removes the hardcoded textTransform style in favor of default styles.
This also fix the issue where textTransform style was not working as expected.
* Add support for color, typography and spacing to stock indicator block
This commit updates the stock-indicator block support in the woocommerce-blocks repository. It includes the following changes:
- Added support for background color, line height, and various experimental typography features.
- Conditionally included support for margin and padding based on the availability of the __experimentalGetSpacingClassesAndStyles function from the @wordpress/block-editor package.
These updates provide more customization options for the stock-indicator block, allowing users to better match the appearance of this element to their site's design.
* Refactor stock text generation and apply minor style adjustments
This commit introduces a new function, `getTextBasedOnStock`, which handles the generation of stock text based on the stock information provided. It replaces the previous `lowStockText` and `stockText` functions, making the code more readable and maintainable.
In addition, minor adjustments to the class name handling have been made to simplify the code and ensure consistent styling when used inside the All Products block.
In the `edit.tsx` file, the `useBlockProps` function call has been updated to include the default `wc-block-components-product-stock-indicator` class name, ensuring it is always applied.
* Remove redundant block type supports in ProductStockIndicator
This commit removes the redundant get_block_type_supports() method from the ProductStockIndicator.php file, as it is no longer needed. The block type supports are now handled in the frontend.
This commit refactors the update_rest_query method in the ProductQuery.php file to improve code readability. It simplifies conditional expressions by introducing variables for clarity, and uses ternary operators to streamline the logic.
* Set up Playwright
* Use caching in GitHub Actions
* Update tests/e2e-pw/README.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Rename “{blockName}” to “{blockName} block”
* Disable “no-console” for setup and teardown files
* Remove obsolete log and adjusted disabled ESLint definition
* Remove conditional logic from actions/upload-artifact
---------
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>