Commit Graph

5217 Commits

Author SHA1 Message Date
dependabot[bot] b6c544a535 Bump @typescript-eslint/eslint-plugin from 5.47.0 to 5.56.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8879)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.47.0 to 5.56.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.56.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-27 17:13:38 +00:00
Thomas Roberts be2ba748be Check for address on shippingData (https://github.com/woocommerce/woocommerce-blocks/pull/8878) 2023-03-27 09:33:18 -07:00
Mike Jolley 3d1caca059 Adjust response method in checkout route (https://github.com/woocommerce/woocommerce-blocks/pull/8822) 2023-03-27 14:59:18 +01:00
Luigi Teschio be4550bf5f Add compatibility layer documentation (https://github.com/woocommerce/woocommerce-blocks/pull/8854)
* add compatibility layer documentation

* Update docs/internal-developers/blockified-templates/compatibility-layer.md

Co-authored-by: kmanijak <karol.manijak@automattic.com>

---------

Co-authored-by: kmanijak <karol.manijak@automattic.com>
2023-03-27 09:41:15 +00:00
Albert Juhé Lluveras 1274a4f5b1 Release process: move the step to update the release PR to the bottom (https://github.com/woocommerce/woocommerce-blocks/pull/8836) 2023-03-27 12:41:09 +04:00
dependabot[bot] 59707b1a98 Bump lint-staged from 13.0.3 to 13.2.0 (https://github.com/woocommerce/woocommerce-blocks/pull/8793)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 13.0.3 to 13.2.0.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v13.0.3...v13.2.0)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-26 17:28:02 -03:00
Luigi Teschio 746bbf7be3 Single Product Template: add the Store Notice block to the template (https://github.com/woocommerce/woocommerce-blocks/pull/8833)
* Add minimum structure for Single Product Details block

* Add Product Image Gallery woocommerce/woocommerce-blocks#8233

Add Product Image Gallery

* First try to render Product Arhcive template as blocks

* First iteration of the whole blockified product archive template

* Add tests for Single Product Details block

* Extract a blockified Product Archive Template to the templates

* Add templates to tsconfig.json so the files are resolved as part of the core code

* Add a encouragement note to use blockified version IF migration is available

* Add a Row block wrapping Product Results Count and Catalog Sorting blocks

* Move blockified product-archive from templates/ to assets/ directory

* Remove unnecessary margin from Product Results Count block

When used in a Row block in a blockified Archive Product template, Product Results Count had additional unnecessary margin which caused misalignment with the Catalog Sorting block

* Fix TypeScript error

* Update the description of the Classic Template Editor placeholder

* Remove unnecessary entry in tsconfig.json to include templates directory

It was added couple of commits earlier, since the template was kept there, but it was decided to move it to assets directory, so entry is no longer necessary

* Move the  to

* Differentiate the Classic Template placeholder description depending on the availability to convert to Products block

* Add the initial basis for the Add to Cart button

* Add E2E test that the Classic Template can be replaced with the blockified version

* Abandon writing E2E tests for now, as there's a problem to run them locally

* Trigger the single product add to cart action for each product type.

* Syntax improvement

* Set margin for Catalog Sorting to 0, so it aligns properly when used in blockified Archive Product template

* Make the blockification config, so it covers the Product Archive as well as Single Product templates

* Move the product-archive specific functions from classic-template/index.tsx to the product-archive.ts

* wip: create block structure and add initial styles

* Add alignment option to the Store Notices block and make the blockified template blocks aligned wide

That is required, so the Classic Template layout is preserved

* Create single-product.ts file which is a placeholder for the blockified Single Product template

* Add block details to the SingleProductDetails.php file

* Make Blockified Product Archive template inherit the align attibute

* Simplify the interface of blockified templates

Expose  function instead of two functions for allowing and disallowing conversion

* Add a BlockifiedTemplate type

* Rename and simplify the function checking if conversion of classic template to block version is possible

* Rename the block from add-to-cart-button to add-to-cart-form

* Update to use the cart icon.

* Align the variable naming to use  instead of

* Implement the skeleton for the editor preview.

* Render tabs title with empty content

* Use woocommerce_output_product_data_tabs function to retrieve tabs data

* Update styles and add Notice for the display in the Editor.

* Update CSS.

* Add base tests for the new Add to Cart Form component.

* Add Product Image Gallery block

* Pass the Classic Template attributes to the blockified template instead of getting it from data store

* Include Breadcrumbs block in the Blockified Product Archive Template

* Consume alignment attributes of Catalog Sorting in the PHP render function

* Consume alignment attributes of Breadcrumbs in the PHP render function

* Show conversion button with label and description

* Add conversion placeholder (until we have all the blocks implemented)

* Remove align support from Catalog Sorting and add to Store Notices block

* remove support global styles

* remove support global styles

* Update the button CSS.

* Remove customizations for the Single Product Details block

* Update styles for the cart form.

* update td style.

* Update divs and CSS.

* Use conventional input instead of the experimental InputControl

* Extend the get_classes_and_styles_by_attributes method with align and text_align attributes

* address CSS feedback

* Add Archive Title block to the Blockified Classic Template

* Minor getRowBlock function refactor

* add support for the custom classname

* remove save function

* Add  property to the classic templates and base the config on it instead of placeholder

* Add separate blockified template for a Product Search Results

* Pass  attribute from classic template to No Results block in Product Search Results

* Remove unnecessary console.log from the Edit.tsx file

* Remove block classname from block wrapper

* Remove unnecessary WooCommerce tabs filter from the BlockTemplatesController

* Remove attributes property from the block registration

* Remove isExperimental flag for the Single Product Details block

* Remove get_classes_and_styles_by_attributes method from SingleProductDetails block

* Prevent Single Product Details block from apppearing in Pages or Posts

* Extract the common functions between blockified archive-template and product-search-results to utils

* Enable 'Inherit query from template' in Products block by default when converting the Classic Template to blockified one

* add second parameter to the subscribe function

* Implement the new design and copy provided for the editor.

* Make the notice compatible with dark themes.

* Some additional CSS tweaks

* adjust the padding for the input

* wrap the Single Product Template in a div with the product class

* Fix PHP Coding Standards warnings

* Improve the naming of BlockifiedTemplateConfig type

* Differentiate Product Catalog and Products By * templates. The latter include Term Description block

* improve logic and increase coverage of unit test

* Change unclear ProductsBy to ProductTaxonomy in regards to classic template conversion

* improve logic and increase coverage of unit test

* fix test

* format HTML

* fix edge case

* update @types/wordpress__data package

* update placeholder, icon and description

* update tsconfig

* update block name

* fix SCSS linter error

* address feedback

* create SingleProductTemplateCompatibility class

* Revert the margin fix which was added already on trunk

* Add Hooks compatibility

* remove not used file

* remove not used files

* Add compatibility layer for the Single Product template

* fix check

* implement Product meta template header

* Add default Single Product HTML template

* Fix style issues when adding blocks inside group/stack/columns blocks

* Add Related Products to the default single product template HTML file

* Product Price Block: Add support Single Product Template

* fix missing import

* add comment

* return a value

* improve comment

* fix import

* Add Product Meta block

* wrap up default single product html

* remove classname

* add blocks

* improve code

* Remove !important statement from Product Image Gallery block css

* Change width of Product Image Gallery block to initial instead of unset

* Wrap up default single product html template (https://github.com/woocommerce/woocommerce-blocks/pull/8632)

* Add minimum structure for Single Product Details block

* Add Product Image Gallery woocommerce/woocommerce-blocks#8233

Add Product Image Gallery

* Add tests for Single Product Details block

* Add the initial basis for the Add to Cart button

* Trigger the single product add to cart action for each product type.

* wip: create block structure and add initial styles

* Add block details to the SingleProductDetails.php file

* Rename the block from add-to-cart-button to add-to-cart-form

* Update to use the cart icon.

* Implement the skeleton for the editor preview.

* Render tabs title with empty content

* Use woocommerce_output_product_data_tabs function to retrieve tabs data

* Update styles and add Notice for the display in the Editor.

* Update CSS.

* Add base tests for the new Add to Cart Form component.

* Add Product Image Gallery block

* remove support global styles

* remove support global styles

* Update the button CSS.

* Remove customizations for the Single Product Details block

* Update styles for the cart form.

* update td style.

* Update divs and CSS.

* Use conventional input instead of the experimental InputControl

* address CSS feedback

* add support for the custom classname

* remove save function

* Remove unnecessary console.log from the Edit.tsx file

* Remove block classname from block wrapper

* Remove unnecessary WooCommerce tabs filter from the BlockTemplatesController

* Remove attributes property from the block registration

* Remove isExperimental flag for the Single Product Details block

* Remove get_classes_and_styles_by_attributes method from SingleProductDetails block

* Prevent Single Product Details block from apppearing in Pages or Posts

* add second parameter to the subscribe function

* Implement the new design and copy provided for the editor.

* Make the notice compatible with dark themes.

* Some additional CSS tweaks

* adjust the padding for the input

* wrap the Single Product Template in a div with the product class

* Fix PHP Coding Standards warnings

* improve logic and increase coverage of unit test

* improve logic and increase coverage of unit test

* fix test

* format HTML

* fix edge case

* update @types/wordpress__data package

* update placeholder, icon and description

* update tsconfig

* update block name

* fix SCSS linter error

* address feedback

* create SingleProductTemplateCompatibility class

* Add Hooks compatibility

* remove not used file

* remove not used files

* Add compatibility layer for the Single Product template

* fix check

* implement Product meta template header

* Product Price Block: Add support Single Product Template

* fix missing import

* add comment

* return a value

* improve comment

* fix import

* Add Product Meta block

* wrap up default single product html

* fix: related products and grouped products result woocommerce/woocommerce-blocks#8589

* remove classname

* fix crash

* update template

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>

* Fix images width in the Single Product page

* Remove the !important attribute from the Product Image Gallery block

* fix sku block

* improve layout

* improve layout

* improve layout

* improve layout

* improve layout

* update label

* Single Product Template: add store notice block

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
2023-03-26 21:19:28 +02:00
dependabot[bot] a2ae2a5527 Bump @storybook/addon-a11y from 6.5.9 to 6.5.16 (https://github.com/woocommerce/woocommerce-blocks/pull/8722)
Bumps [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/addons/a11y) from 6.5.9 to 6.5.16.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.16/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.16/addons/a11y)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-26 16:17:18 -03:00
dependabot[bot] 867e183700 Bump @types/react from 17.0.47 to 18.0.29 (https://github.com/woocommerce/woocommerce-blocks/pull/8852)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 17.0.47 to 18.0.29.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-26 14:26:27 +00:00
Alexandre Lara 22a9a479ae Related Products: Move Notice block to the Inspector Control section (https://github.com/woocommerce/woocommerce-blocks/pull/8843)
* Add Notice component to the Inspector Controls section of the Related Products block

* Change margin css attribute to use the short syntax

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-03-24 14:03:12 -03:00
Alba Rincón 91eb482e17 Mini-cart buttons: add explanation regarding why we need to check for children (https://github.com/woocommerce/woocommerce-blocks/pull/8847)
* Add comment explanation regarding the children buttons

* Update comment

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-03-24 16:25:09 +01:00
Saad Tarhi 2662cf09bd Update 970.md 2023-03-24 15:01:02 +00:00
Alba Rincón aa601fe102 Mini-cart: add the option to change the style between 'Outline' and 'Fill' in all the buttons (https://github.com/woocommerce/woocommerce-blocks/pull/8835)
* Render inner buttons on the frontend

* Add deprecation to the buttons

* Fix lint and inline save

* Remove commented out code and fix condition

* Change migrate condition

* Add styles outline and fill styles to cart and checkout buttons

* Add fill and outline styles to the start shopping button

* Refactor variants

* Remove imports

* Add classname default value

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2023-03-24 10:14:06 +01:00
Manish Menaria 1416642cd2 Add more Inspector controls for Product(Add to cart) button (https://github.com/woocommerce/woocommerce-blocks/pull/8781)
* Add Fill & Outline styles to Product button

This commit adds the Fill & Outline styles to the Product button block.
You can see new Styles section in Inspector Controls where you will be able to change between Fill & Outline styles.

* Add width setting to product button

The button block now has a width selector, which allows the user to
set the button to 25%, 50%, 75%, or 100% of the parent container.
By default, a button's width is determined by the size of its content.

You can find this setting in the button block's sidebar.

* Enable all typography controls

Now following typography controls are also available:
- Font Family
- Appearance
- Line height
- Letter spacing
- Decoration
- Letter case

* Fix width settings not working

* Fix align doesn't work with Width settings

* Fix width setting not working in Single product block

* Fix - Default button is shorter on the frontend

In Editor default and outlined button has the same height. Outlined button in the frontend as well. But default button on the frontend is shorter (smaller padding)

More info: https://github.com/woocommerce/woocommerce-blocks/pull/8781#issuecomment-1477527049

* Fix - background color not matching when GB is enabled

* Fix - 100% width button exceeds the container

Fix following issues:
- "Select Options" or "View products" for variable and grouped products don't respect the container max width
- Also, for small width (25%) they are wider

More info: https://github.com/woocommerce/woocommerce-blocks/pull/8781#issuecomment-1477527049

* Fix: Width setting not working in All Products block

This commit fixes the width setting not working in the All Products block.

* Keep other classes along with Width setting classes

`block.attributes.className` should be kept along with the width setting classes.
```
className: classnames( block.attributes.className, {
	[ `has-custom-width wp-block-button__width-${ block.attributes?.width }` ]:
		block.attributes?.width,
} )
```

* Translate styles label in block configuration
2023-03-24 12:38:43 +05:30
Tarun Vijwani 8b57aa35cb Fix _n usage to use plural and singular correctly (https://github.com/woocommerce/woocommerce-blocks/pull/8749)
* Fix _n usage to use plural and singular correctly

* Replace switch condition with if else

- Replace switch condition with if else for better readability.

* Add packageCount in LocalPickupSelect component

- packageCount prop was missing from LocalPickupSelect component. Add packageCount in LocalPickupSelect component.

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2023-03-24 10:52:38 +04:00
Luigi Teschio 4451dbb323 Product Image Gallery: remove attributes key (https://github.com/woocommerce/woocommerce-blocks/pull/8825) 2023-03-23 18:00:16 +01:00
Alba Rincón 2555beadf5 Provide a way to switch to the blockified Single Product Template (https://github.com/woocommerce/woocommerce-blocks/pull/8324)
* Add minimum structure for Single Product Details block

* Add Product Image Gallery woocommerce/woocommerce-blocks#8233

Add Product Image Gallery

* First try to render Product Arhcive template as blocks

* First iteration of the whole blockified product archive template

* Add tests for Single Product Details block

* Extract a blockified Product Archive Template to the templates

* Add templates to tsconfig.json so the files are resolved as part of the core code

* Add a encouragement note to use blockified version IF migration is available

* Add a Row block wrapping Product Results Count and Catalog Sorting blocks

* Move blockified product-archive from templates/ to assets/ directory

* Remove unnecessary margin from Product Results Count block

When used in a Row block in a blockified Archive Product template, Product Results Count had additional unnecessary margin which caused misalignment with the Catalog Sorting block

* Fix TypeScript error

* Update the description of the Classic Template Editor placeholder

* Remove unnecessary entry in tsconfig.json to include templates directory

It was added couple of commits earlier, since the template was kept there, but it was decided to move it to assets directory, so entry is no longer necessary

* Move the  to

* Differentiate the Classic Template placeholder description depending on the availability to convert to Products block

* Add the initial basis for the Add to Cart button

* Add E2E test that the Classic Template can be replaced with the blockified version

* Abandon writing E2E tests for now, as there's a problem to run them locally

* Trigger the single product add to cart action for each product type.

* Syntax improvement

* Set margin for Catalog Sorting to 0, so it aligns properly when used in blockified Archive Product template

* Make the blockification config, so it covers the Product Archive as well as Single Product templates

* Move the product-archive specific functions from classic-template/index.tsx to the product-archive.ts

* wip: create block structure and add initial styles

* Add alignment option to the Store Notices block and make the blockified template blocks aligned wide

That is required, so the Classic Template layout is preserved

* Create single-product.ts file which is a placeholder for the blockified Single Product template

* Add block details to the SingleProductDetails.php file

* Make Blockified Product Archive template inherit the align attibute

* Simplify the interface of blockified templates

Expose  function instead of two functions for allowing and disallowing conversion

* Add a BlockifiedTemplate type

* Rename and simplify the function checking if conversion of classic template to block version is possible

* Rename the block from add-to-cart-button to add-to-cart-form

* Update to use the cart icon.

* Align the variable naming to use  instead of

* Implement the skeleton for the editor preview.

* Render tabs title with empty content

* Use woocommerce_output_product_data_tabs function to retrieve tabs data

* Update styles and add Notice for the display in the Editor.

* Update CSS.

* Add base tests for the new Add to Cart Form component.

* Add Product Image Gallery block

* Pass the Classic Template attributes to the blockified template instead of getting it from data store

* Include Breadcrumbs block in the Blockified Product Archive Template

* Consume alignment attributes of Catalog Sorting in the PHP render function

* Consume alignment attributes of Breadcrumbs in the PHP render function

* Show conversion button with label and description

* Add conversion placeholder (until we have all the blocks implemented)

* Remove align support from Catalog Sorting and add to Store Notices block

* remove support global styles

* remove support global styles

* Update the button CSS.

* Remove customizations for the Single Product Details block

* Update styles for the cart form.

* update td style.

* Update divs and CSS.

* Use conventional input instead of the experimental InputControl

* Extend the get_classes_and_styles_by_attributes method with align and text_align attributes

* address CSS feedback

* Add Archive Title block to the Blockified Classic Template

* Minor getRowBlock function refactor

* add support for the custom classname

* remove save function

* Add  property to the classic templates and base the config on it instead of placeholder

* Add separate blockified template for a Product Search Results

* Pass  attribute from classic template to No Results block in Product Search Results

* Remove unnecessary console.log from the Edit.tsx file

* Remove block classname from block wrapper

* Remove unnecessary WooCommerce tabs filter from the BlockTemplatesController

* Remove attributes property from the block registration

* Remove isExperimental flag for the Single Product Details block

* Remove get_classes_and_styles_by_attributes method from SingleProductDetails block

* Prevent Single Product Details block from apppearing in Pages or Posts

* Extract the common functions between blockified archive-template and product-search-results to utils

* Enable 'Inherit query from template' in Products block by default when converting the Classic Template to blockified one

* add second parameter to the subscribe function

* Implement the new design and copy provided for the editor.

* Make the notice compatible with dark themes.

* Some additional CSS tweaks

* adjust the padding for the input

* wrap the Single Product Template in a div with the product class

* Fix PHP Coding Standards warnings

* Improve the naming of BlockifiedTemplateConfig type

* Differentiate Product Catalog and Products By * templates. The latter include Term Description block

* improve logic and increase coverage of unit test

* Change unclear ProductsBy to ProductTaxonomy in regards to classic template conversion

* improve logic and increase coverage of unit test

* fix test

* format HTML

* fix edge case

* update @types/wordpress__data package

* update placeholder, icon and description

* update tsconfig

* update block name

* fix SCSS linter error

* address feedback

* create SingleProductTemplateCompatibility class

* Revert the margin fix which was added already on trunk

* Add Hooks compatibility

* remove not used file

* remove not used files

* Add compatibility layer for the Single Product template

* fix check

* implement Product meta template header

* Add default Single Product HTML template

* Fix style issues when adding blocks inside group/stack/columns blocks

* Add Related Products to the default single product template HTML file

* Product Price Block: Add support Single Product Template

* fix missing import

* add comment

* return a value

* improve comment

* fix import

* Add Product Meta block

* wrap up default single product html

* remove classname

* add blocks

* improve code

* Remove !important statement from Product Image Gallery block css

* Change width of Product Image Gallery block to initial instead of unset

* Wrap up default single product html template (https://github.com/woocommerce/woocommerce-blocks/pull/8632)

* Add minimum structure for Single Product Details block

* Add Product Image Gallery woocommerce/woocommerce-blocks#8233

Add Product Image Gallery

* Add tests for Single Product Details block

* Add the initial basis for the Add to Cart button

* Trigger the single product add to cart action for each product type.

* wip: create block structure and add initial styles

* Add block details to the SingleProductDetails.php file

* Rename the block from add-to-cart-button to add-to-cart-form

* Update to use the cart icon.

* Implement the skeleton for the editor preview.

* Render tabs title with empty content

* Use woocommerce_output_product_data_tabs function to retrieve tabs data

* Update styles and add Notice for the display in the Editor.

* Update CSS.

* Add base tests for the new Add to Cart Form component.

* Add Product Image Gallery block

* remove support global styles

* remove support global styles

* Update the button CSS.

* Remove customizations for the Single Product Details block

* Update styles for the cart form.

* update td style.

* Update divs and CSS.

* Use conventional input instead of the experimental InputControl

* address CSS feedback

* add support for the custom classname

* remove save function

* Remove unnecessary console.log from the Edit.tsx file

* Remove block classname from block wrapper

* Remove unnecessary WooCommerce tabs filter from the BlockTemplatesController

* Remove attributes property from the block registration

* Remove isExperimental flag for the Single Product Details block

* Remove get_classes_and_styles_by_attributes method from SingleProductDetails block

* Prevent Single Product Details block from apppearing in Pages or Posts

* add second parameter to the subscribe function

* Implement the new design and copy provided for the editor.

* Make the notice compatible with dark themes.

* Some additional CSS tweaks

* adjust the padding for the input

* wrap the Single Product Template in a div with the product class

* Fix PHP Coding Standards warnings

* improve logic and increase coverage of unit test

* improve logic and increase coverage of unit test

* fix test

* format HTML

* fix edge case

* update @types/wordpress__data package

* update placeholder, icon and description

* update tsconfig

* update block name

* fix SCSS linter error

* address feedback

* create SingleProductTemplateCompatibility class

* Add Hooks compatibility

* remove not used file

* remove not used files

* Add compatibility layer for the Single Product template

* fix check

* implement Product meta template header

* Product Price Block: Add support Single Product Template

* fix missing import

* add comment

* return a value

* improve comment

* fix import

* Add Product Meta block

* wrap up default single product html

* fix: related products and grouped products result woocommerce/woocommerce-blocks#8589

* remove classname

* fix crash

* update template

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>

* Fix images width in the Single Product page

* Remove the !important attribute from the Product Image Gallery block

* fix sku block

* improve layout

* improve layout

* improve layout

* improve layout

* improve layout

* update label

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-03-23 17:59:59 +01:00
Alba Rincón 2d9519b3ba Add style to the `Mini Cart` buttons (https://github.com/woocommerce/woocommerce-blocks/pull/8776)
* Create new car button inner block

* Create new checkout button inner block

* Render inner buttons on the frontend

* Fix buttons size

* Add outline to the cart button

* Add color props

* Add urls

* Fix button classes

* Add classes to edit

* Start using editable button

* Add buttons to mini cart tempalte

* Reorder buttons in template

* Add cart & checkout buttons scripts

* Remove unnecessary divs

* Change checkout button block name

* Change cart button block name

* Add deprecation to the buttons

* Fix lint and inline save

* Remove commented out code and fix condition

* Render buttons if no children

* Change migrate condition

* Simplify condition

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* Make props optional

* Add missing import

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-03-23 16:55:53 +01:00
Albert Juhé Lluveras c9a6391e20 Fix border styles not visible in the editor in Featured Product and Featured Category blocks in core (https://github.com/woocommerce/woocommerce-blocks/pull/8838) 2023-03-23 15:36:46 +01:00
Albert Juhé Lluveras bf73555ee3 Update woocommerce/woocommerce-blocks#8494 testing steps for WC Blocks 9.7.0 to account for recent changes introduced after the PR was created 2023-03-23 15:19:13 +01:00
Luigi Teschio d5cb9b0248 Product SKU: no render the prefix when the SKU isn't defined (https://github.com/woocommerce/woocommerce-blocks/pull/8837) 2023-03-23 14:08:48 +00:00
Roy Ho 48fde013ea Add decoding to product names (https://github.com/woocommerce/woocommerce-blocks/pull/8824)
* Add decoding to product names

* Fix linting error
2023-03-23 06:27:02 -07:00
Albert Juhé Lluveras 0bfd760c25 9.7.0 testing steps: move Product Price styling steps to the Feature Plugin section 2023-03-23 11:59:51 +01:00
Mike Jolley 280040653c Avoid returning before hooks are run (https://github.com/woocommerce/woocommerce-blocks/pull/8820) 2023-03-23 10:24:04 +00:00
Luigi Teschio 9baad55f4f Stock Indicator Block: remove unused save function (https://github.com/woocommerce/woocommerce-blocks/pull/8832) 2023-03-23 08:43:42 +00:00
kmanijak a06f4fbd91 Normalise the search param for comparison to avoid endless redirections (https://github.com/woocommerce/woocommerce-blocks/pull/8784)
* Replace single quote with the encoded version %27 for URL comparison

This is required as as removeQueryArgs() function uses decodeURIcomponent method which doesn't encode single quotes (') while it was still encoded in the original URL (%27). So when the single quote was in a query param, for example as a search term, it caused endless redirection loop.

* Replace single quote with the encoded version %27 for URL comparison in Filter by Rating

* refactor the solution so it encodes the href rather than decode the newly created URL

* Refactor the normalisation

* Add tests to normalisation function
2023-03-23 08:42:23 +01:00
Albert Juhé Lluveras f29954abbc Add 9.8.2 testing steps 2023-03-22 16:07:16 +01:00
Albert Juhé Lluveras 03846552cf Add 9.8.2 changelog 2023-03-22 16:07:09 +01:00
Alexandre Lara f39d8b7943 Add default Single Product HTML template (https://github.com/woocommerce/woocommerce-blocks/pull/8515)
* Add default Single Product HTML template

* Fix style issues when adding blocks inside group/stack/columns blocks

* Add Related Products to the default single product template HTML file

* Remove !important statement from Product Image Gallery block css

* Change width of Product Image Gallery block to initial instead of unset

* Wrap up default single product html template (https://github.com/woocommerce/woocommerce-blocks/pull/8632)

* Add minimum structure for Single Product Details block

* Add Product Image Gallery woocommerce/woocommerce-blocks#8233

Add Product Image Gallery

* Add tests for Single Product Details block

* Add the initial basis for the Add to Cart button

* Trigger the single product add to cart action for each product type.

* wip: create block structure and add initial styles

* Add block details to the SingleProductDetails.php file

* Rename the block from add-to-cart-button to add-to-cart-form

* Update to use the cart icon.

* Implement the skeleton for the editor preview.

* Render tabs title with empty content

* Use woocommerce_output_product_data_tabs function to retrieve tabs data

* Update styles and add Notice for the display in the Editor.

* Update CSS.

* Add base tests for the new Add to Cart Form component.

* Add Product Image Gallery block

* remove support global styles

* remove support global styles

* Update the button CSS.

* Remove customizations for the Single Product Details block

* Update styles for the cart form.

* update td style.

* Update divs and CSS.

* Use conventional input instead of the experimental InputControl

* address CSS feedback

* add support for the custom classname

* remove save function

* Remove unnecessary console.log from the Edit.tsx file

* Remove block classname from block wrapper

* Remove unnecessary WooCommerce tabs filter from the BlockTemplatesController

* Remove attributes property from the block registration

* Remove isExperimental flag for the Single Product Details block

* Remove get_classes_and_styles_by_attributes method from SingleProductDetails block

* Prevent Single Product Details block from apppearing in Pages or Posts

* add second parameter to the subscribe function

* Implement the new design and copy provided for the editor.

* Make the notice compatible with dark themes.

* Some additional CSS tweaks

* adjust the padding for the input

* wrap the Single Product Template in a div with the product class

* Fix PHP Coding Standards warnings

* improve logic and increase coverage of unit test

* improve logic and increase coverage of unit test

* fix test

* format HTML

* fix edge case

* update @types/wordpress__data package

* update placeholder, icon and description

* update tsconfig

* update block name

* fix SCSS linter error

* address feedback

* create SingleProductTemplateCompatibility class

* Add Hooks compatibility

* remove not used file

* remove not used files

* Add compatibility layer for the Single Product template

* fix check

* implement Product meta template header

* Product Price Block: Add support Single Product Template

* fix missing import

* add comment

* return a value

* improve comment

* fix import

* Add Product Meta block

* wrap up default single product html

* fix: related products and grouped products result woocommerce/woocommerce-blocks#8589

* remove classname

* fix crash

* update template

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>

* Fix images width in the Single Product page

* Remove the !important attribute from the Product Image Gallery block

* fix sku block

* improve layout

* fix header and footer template parts declaration

---------

Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-03-22 15:00:48 +00:00
Albert Juhé Lluveras 24be5ab041 Update 9.8.0 testing steps for woocommerce/woocommerce-blocks#8594 so they account for WC core testing 2023-03-22 14:04:42 +01:00
Paulo Arromba 9f7bf6fb04 Added CheckoutSchema::$image_attachment_schema property (https://github.com/woocommerce/woocommerce-blocks/pull/8802) 2023-03-22 13:04:24 +00:00
Saad Tarhi 547cc76f8e Fix save changes bug in Firefox browser (https://github.com/woocommerce/woocommerce-blocks/pull/8754) 2023-03-22 12:45:48 +00:00
kmanijak a5714a6519 Use shared save function for all the product elements blocks (https://github.com/woocommerce/woocommerce-blocks/pull/8813)
* Use attributes provided to save function in product-price block

* remove save function and use the shared one

* fix import

---------

Co-authored-by: Luigi <gigitux@gmail.com>
2023-03-22 11:52:50 +00:00
Seghir Nadir ad23e12dc9 fix shipping test (https://github.com/woocommerce/woocommerce-blocks/pull/8815) 2023-03-22 12:24:45 +01:00
kmanijak 752fd37a0b Make Product SKU editable (https://github.com/woocommerce/woocommerce-blocks/pull/8804) 2023-03-22 09:29:49 +01:00
Albert Juhé Lluveras 5235f6c392 Allow themes to remove the Mini Cart title on overridden template parts (https://github.com/woocommerce/woocommerce-blocks/pull/8779)
* Allow themes to remove the Mini Cart title on overridden template parts

* Remove unused file
2023-03-22 08:23:52 +01:00
Tarun Vijwani 82c59ffb29 Display the link to add the shipping address when shipping address is not available (https://github.com/woocommerce/woocommerce-blocks/pull/8141) 2023-03-22 11:15:13 +04:00
Albert Juhé Lluveras 6a629c60b2 Fix Customer Account block doing a 404 request in the frontend (https://github.com/woocommerce/woocommerce-blocks/pull/8798) 2023-03-21 11:31:20 +01:00
Mike Jolley ef97fad080 Add woocommerce_cart_item_permalink filter to cart endpoint (https://github.com/woocommerce/woocommerce-blocks/pull/8726) 2023-03-21 10:14:29 +00:00
Albert Juhé Lluveras a85b80e6ac Update release version at the beginning of the release process (https://github.com/woocommerce/woocommerce-blocks/pull/8788)
* Update release version at the beginning of the release process

* Add back code that updated versions on deploy
2023-03-20 18:07:15 +01:00
Luigi Teschio f9cdca7625 Remove Single Product Block (https://github.com/woocommerce/woocommerce-blocks/pull/8763)
* Remove Single Product Block

* remove more files that belong the Single Product block

* fix php linter error

* remove Product Tag List and Product Category List blocks
2023-03-20 13:27:23 +00:00
Albert Juhé Lluveras 23312534da Release process: check svn tag before WP.org version and add instruction about dev notes (https://github.com/woocommerce/woocommerce-blocks/pull/8756)
* Release steps: check svn version before checking WP.org version

* Add instruction to include dev notes
2023-03-20 11:24:06 +01:00
Luigi 82d27155d5 Merge branch 'release/9.6.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2023-03-17 16:59:27 +01:00
github-actions[bot] 29e49f76d5 Release: 9.6.6 (https://github.com/woocommerce/woocommerce-blocks/pull/8778)
* Empty commit for release pull request

* Add changelog to readme.txt

* Unset default customer state if it doesn't match country (https://github.com/woocommerce/woocommerce-blocks/pull/8460)

* Unset default state

* add controller for customers

* rename validation file

* explain fix inline

* address feedback

* revert back state logic

* Update src/StoreApi/Utilities/ValidationUtils.php

Co-authored-by: Mike Jolley <mike.jolley@me.com>

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Update readme.txt

* Add testing notes

* Update testing notes

* Fix Customer account sidebar link incorrect margin in WP 6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/8437)

* Fix Customer account sidebar link incorrect margin in WP 6.2

* Update class name to match the guidelines

* Prevent cart from breaking when item_data contains an array (https://github.com/woocommerce/woocommerce-blocks/pull/8440)

* Ensure array item data is removed

* Remove unused key

* Clean up code and add comments

* Check for null instead of empty

* Use plain foreach to filter and map arrays

* Add minimum height to Mini Cart Contents block in the Style Book (https://github.com/woocommerce/woocommerce-blocks/pull/8458)

* Update testing notes zip file

* Update testing notes

* Update testing notes file

* Bumping version strings to new version.

* Empty commit for release pull request

* Empty commit for release pull request

* disable compatibilty layer (https://github.com/woocommerce/woocommerce-blocks/pull/8507)

* update changelog and testing instructions

* add zip link

* Bumping version strings to new version.

* Empty commit for release pull request

* Empty commit for release pull request

* Add changelog in readme.txt

* Add testing notes

* Remove change from testing notes

This requires AvaTax credentials for testing. So, we'll test for
regressions instead

* Check for null session before going forward (https://github.com/woocommerce/woocommerce-blocks/pull/8537)

* Fix Payment Options settings crash in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/8535)

* Ensure express payment buttons are visible next to each other (https://github.com/woocommerce/woocommerce-blocks/pull/8548)

* Update ZIP file

* Bumping version strings to new version.

* Empty commit for release pull request

* Empty commit for release pull request

* Update readme.txt

* Show three Express Payments buttons in-line (https://github.com/woocommerce/woocommerce-blocks/pull/8601)

* Add testing notes

* Bumping version strings to new version.

* Empty commit for release pull request

* Empty commit for release pull request

* Add changelog in readme.txt

* Undo dirty prop removal on error (https://github.com/woocommerce/woocommerce-blocks/pull/8633)

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>

* Add testing notes

* fix 404 error (https://github.com/woocommerce/woocommerce-blocks/pull/8445)

* Empty commit for release pull request

* add testing instruction

* update zip link

* fix version

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2023-03-17 16:47:41 +01:00
Tarun Vijwani ef24a42211 Add validation error to prevent checkout when there is no shipping method available (https://github.com/woocommerce/woocommerce-blocks/pull/8384)
* Prevent checkout when no shipping rates available

-  Add the validation error in ShippingSelector to prevent checkout when no shipping rates available.
- Add notice to Checkout processor so that notice appears after clicking on place order button.

* Fix TypeScript error in checkout shipping method block

-   Make multiple prop as optional in RatePrice component to fix TypeScript error.
2023-03-17 19:32:03 +04:00
Mike Jolley 68c6990872 Enhancement/local pickup order confirmation (https://github.com/woocommerce/woocommerce-blocks/pull/8727)
* Hide shipping address from local pickup order confirmation page

* Add pickup details to confirmations

* Error handling

* Update test because columns may be hidden

* use address selector

* Custom selector for local pickup

* try forcing flat rate during test
2023-03-17 14:15:13 +00:00
Albert Juhé Lluveras ec19838355 Fix issue that prevented spaces being added to Mini Cart, Cart and Checkout buttons (https://github.com/woocommerce/woocommerce-blocks/pull/8777)
* Fix issue that prevented spaces being added to Mini Cart, Cart and Checkout buttons

* Fix a couple of comments
2023-03-17 13:26:34 +01:00
kmanijak 28c7bfc801 Change the example of GET products by category from category name to ID (https://github.com/woocommerce/woocommerce-blocks/pull/8774) 2023-03-17 13:24:00 +01:00
Luigi Teschio 6dfee2664e fix isDescendentOfSingleProductTemplate check (https://github.com/woocommerce/woocommerce-blocks/pull/8767) 2023-03-17 10:22:51 +01:00
Alba Rincón dca03c3323 Add styles to the `Start shopping` button (https://github.com/woocommerce/woocommerce-blocks/pull/8766) 2023-03-16 14:57:54 +01:00