create product collection category and move to main docs folder (#50368)

* create product collection category and move to main docs folder

* add readme

* update title

* update title

* add changelog and remove emojis

* Update docs/product-collection-block/register-product-collection.md

Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>

---------

Co-authored-by: Shani <shanibanerjee@gmail.com>
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
This commit is contained in:
piinthecloud 2024-08-05 17:51:32 +02:00 committed by GitHub
parent fd2dbf5517
commit f7f280fd1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 37 additions and 5 deletions

View File

@ -997,6 +997,23 @@
], ],
"categories": [] "categories": []
}, },
{
"content": "",
"category_slug": "product-collection",
"category_title": "Product Collection Block",
"posts": [
{
"post_title": "Registering custom collections in product collection block",
"menu_title": "Registering custom collections",
"tags": "how-to",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/product-collection-block/register-product-collection.md",
"hash": "88445929a9f76512e1e8ff60be7beff7e912f31fbad552abf18862ed85f00585",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/product-collection-block/register-product-collection.md",
"id": "3bf26fc7c56ae6e6a56e1171f750f5204fcfcece"
}
],
"categories": []
},
{ {
"content": "\nDiscover how to customize the WooCommerce product editor, from extending product data to adding unique functionalities.\n\nThis handbook is a guide for extension developers looking to add support for the new product editor in their extensions. The product editor uses [Gutenberg's Block Editor](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-editor), which is going to help WooCommerce evolve alongside the WordPress ecosystem.", "content": "\nDiscover how to customize the WooCommerce product editor, from extending product data to adding unique functionalities.\n\nThis handbook is a guide for extension developers looking to add support for the new product editor in their extensions. The product editor uses [Gutenberg's Block Editor](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-editor), which is going to help WooCommerce evolve alongside the WordPress ecosystem.",
"category_slug": "product-editor", "category_slug": "product-editor",
@ -1680,5 +1697,5 @@
"categories": [] "categories": []
} }
], ],
"hash": "aba0ae4b152f1007f64966aa21601ba73786ce4b1be4219f18ecbf295ee10221" "hash": "c24136612fe16fc7dee435a2ad2198ce242ab63dbba483fd0a18efd88dc3a289"
} }

View File

@ -0,0 +1,5 @@
---
category_title: Product Collection Block
category_slug: product-collection
post_title: Product collection block
---

View File

@ -1,6 +1,12 @@
---
post_title: Registering custom collections in product collection block
menu_title: Registering custom collections
tags: how-to
---
# Register Product Collection # Register Product Collection
The `__experimentalRegisterProductCollection` function is part of the `@woocommerce/blocks-registry` package. This function allows 3PDs to register a new collection. This function accepts most of the arguments that are accepted by [Block Variation](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-variations/#defining-a-block-variation). The `__experimentalRegisterProductCollection` function is part of the `@woocommerce/blocks-registry` package. This function allows third party developers to register a new collection. This function accepts most of the arguments that are accepted by [Block Variation](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-variations/#defining-a-block-variation).
> [!WARNING] > [!WARNING]
> It's experimental and may change in the future. Please use it with caution. > It's experimental and may change in the future. Please use it with caution.
@ -34,8 +40,8 @@ A Collection is defined by an object that can contain the following fields:
- `title` (type `string`): The title of the collection, which will be displayed in various places including the block inserter and collection chooser. - `title` (type `string`): The title of the collection, which will be displayed in various places including the block inserter and collection chooser.
- `description` (optional, type `string`): A human-readable description of the collection. - `description` (optional, type `string`): A human-readable description of the collection.
- `innerBlocks` (optional, type `Array[]`): An array of inner blocks that will be added to the collection. If not provided, the default inner blocks will be used. - `innerBlocks` (optional, type `Array[]`): An array of inner blocks that will be added to the collection. If not provided, the default inner blocks will be used.
- `isDefault`: ⚠️ It's set to `false` for all collections. 3PDs doesn't need to pass this argument. - `isDefault`: It's set to `false` for all collections. Third party developers don't need to pass this argument.
- `isActive`: ⚠️ It will be managed by us. 3PDs doesn't need to pass this argument. - `isActive`: It will be managed by us. Third party developers don't need to pass this argument.
- `usesReference` (optional, type `Array[]`): An array of strings specifying the required reference for the collection. Acceptable values are `product`, `archive`, `cart`, and `order`. When the required reference isn't available on Editor side but will be available in Frontend, we will show a preview label. - `usesReference` (optional, type `Array[]`): An array of strings specifying the required reference for the collection. Acceptable values are `product`, `archive`, `cart`, and `order`. When the required reference isn't available on Editor side but will be available in Frontend, we will show a preview label.
### Attributes ### Attributes
@ -91,7 +97,7 @@ The `preview` attribute is optional, and it is used to set the preview state of
- `attributes` (type `object`): The current attributes of the collection. - `attributes` (type `object`): The current attributes of the collection.
- `location` (type `object`): The location of the collection. Accepted values are `product`, `archive`, `cart`, `order`, `site`. - `location` (type `object`): The location of the collection. Accepted values are `product`, `archive`, `cart`, `order`, `site`.
For more info, you may check PR #46369, in which the Preview feature was added For more info, you may check [PR #46369](https://github.com/woocommerce/woocommerce/pull/46369), in which the Preview feature was added
## Examples ## Examples

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
moving product collection docs to main docs folder