This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document Product Collection Attributes
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Sample Product Collection attributes object with field descriptions | ||
|
||
## Current query attributes | ||
|
||
| Field | Type | Default | Description | | ||
| ----------------------------- | ----------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| perPage | Number | 9 | Number of products per page | | ||
| pages | Number | 0 | Total number of pages Product Collection should allow to browse | | ||
| offset | Number | 0 | Offset of products when starting pagination | | ||
| postType | 'product' | 'post' | product' | The type of posts to fetch. It's 'product' by default and it's very unlikely to change that | | ||
| isProductCollectionBlock | Boolean | true | Specifies that the query is from Product Collection block. There's no case in which it should be changed | | ||
| inherit | Boolean | true | Define it the query should inherit from template query or not. If yes, all the other filters are ignored | | ||
| order | 'asc' | 'desc' | asc' | Determines if the order is ascending or descending | | ||
| orderBy | 'title' | 'date' | 'popularity' | 'rating' | title' | Allows to choose the ordering from presets | | ||
| author | String | - | To be removed. Filter products by the author of the product (post) | | ||
| search | String | - | Filter the products by keyword | | ||
| exclude | ProductID[] | [] | Specified products won't be displayed as results even if they match other filters. There's no UI representation of this filter at the moment | | ||
| woocommerceHandPickedProducts | ProductID[] | [] | Array of products. The whole filtering will be applied only to this set of products | | ||
| woocommerceOnSale | Boolean | false | If true, display only products on sale | | ||
| woocommerceStockStatus | StockStatus[] | [] | Display products from specific stock statuses | | ||
| woocommerceAttributes | [ { termId: TermID, taxonomy: Taxonomy } ] | [] | Display products with specific attributes | | ||
| taxQuery | { product_cat: CategoriesId[], product_tag: TagID[] } | {} | Filter products from specific categories and/or tags | | ||
| parents | Array | [] | ??? | | ||
| sticky | '' | 'only' | String | '' | ??? | | ||
|
||
## Example attributes shape | ||
|
||
```javascript | ||
const exampleAttributes = { | ||
queryId: 0, | ||
tagName: 'div', | ||
displayLayout: { type: 'flex', columns: 2 }, | ||
query: { | ||
perPage: 9, | ||
pages: 0, | ||
offset: 0, | ||
postType: 'product', | ||
order: 'asc', | ||
orderBy: 'title', | ||
author: '', | ||
search: 'hoodie', | ||
exclude: [], | ||
sticky: '', | ||
inherit: false, | ||
taxQuery: { product_cat:[5], product_tag: [39] }, | ||
parents: [], | ||
isProductCollectionBlock: true, | ||
woocommerceOnSale: false, | ||
woocommerceStockStatus: [ 'instock', 'outofstock', 'onbackorder' ], | ||
woocommerceAttributes: [ | ||
{ termId: 47, taxonomy: 'pa_color' }, | ||
{ termId: 11, taxonomy: 'pa_color' }, | ||
{ termId: 18, taxonomy: 'pa_color' }, | ||
{ termId: 12, taxonomy: 'pa_color' }, | ||
{ termId: 13, taxonomy: 'pa_color' }, | ||
{ termId: 19, taxonomy: 'pa_color' }, | ||
], | ||
woocommerceHandPickedProducts: [ '1240', '1239' ], | ||
}, | ||
}; | ||
``` |
Empty file.