2020-02-16 10:43:51 -08:00
import { INodeProperties } from 'n8n-workflow' ;
2021-12-03 00:44:16 -08:00
export const productOperations : INodeProperties [ ] = [
2020-02-16 10:43:51 -08:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-02-16 10:43:51 -08:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'product' ] ,
2020-02-16 10:43:51 -08:00
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
description : 'Create a product' ,
2022-07-10 13:50:51 -07:00
action : 'Create a product' ,
2020-02-16 10:43:51 -08:00
} ,
{
2020-02-21 07:28:56 -08:00
name : 'Delete' ,
value : 'delete' ,
description : 'Delete a product' ,
2022-07-10 13:50:51 -07:00
action : 'Delete a product' ,
2020-02-16 10:43:51 -08:00
} ,
{
name : 'Get' ,
value : 'get' ,
description : 'Get a product' ,
2022-07-10 13:50:51 -07:00
action : 'Get a product' ,
2020-02-16 10:43:51 -08:00
} ,
{
2022-09-07 07:51:14 -07:00
name : 'Get Many' ,
2020-02-16 10:43:51 -08:00
value : 'getAll' ,
2022-09-13 03:36:36 -07:00
description : 'Get many products' ,
2022-09-08 08:10:13 -07:00
action : 'Get many products' ,
2020-02-16 10:43:51 -08:00
} ,
{
2020-02-21 07:28:56 -08:00
name : 'Update' ,
value : 'update' ,
description : 'Update a product' ,
2022-07-10 13:50:51 -07:00
action : 'Update a product' ,
2020-02-16 10:43:51 -08:00
} ,
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-02-16 10:43:51 -08:00
2021-12-03 00:44:16 -08:00
export const productFields : INodeProperties [ ] = [
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* product:create */
/* -------------------------------------------------------------------------- */
2020-02-16 10:43:51 -08:00
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'product' ] ,
operation : [ 'create' ] ,
2020-02-16 10:43:51 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Product name' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'product' ] ,
operation : [ 'create' ] ,
2020-02-16 10:43:51 -08:00
} ,
} ,
options : [
{
displayName : 'Backorders' ,
name : 'backorders' ,
type : 'options' ,
options : [
{
name : 'No' ,
value : 'no' ,
} ,
{
name : 'Notify' ,
value : 'notify' ,
} ,
{
name : 'Yes' ,
value : 'yes' ,
} ,
] ,
default : 'no' ,
description : 'If managing stock, this controls if backorders are allowed' ,
} ,
{
displayName : 'Button Text' ,
name : 'buttonText' ,
type : 'string' ,
default : '' ,
description : 'Product external button text. Only for external products.' ,
} ,
{
displayName : 'Catalog Visibility' ,
name : 'catalogVisibility' ,
type : 'options' ,
options : [
{
name : 'Catalog' ,
value : 'catalog' ,
} ,
2020-02-21 07:28:56 -08:00
{
name : 'Hidden' ,
value : 'hidden' ,
} ,
2020-02-16 10:43:51 -08:00
{
name : 'Search' ,
value : 'search' ,
} ,
{
2020-02-21 07:28:56 -08:00
name : 'Visible' ,
value : 'visible' ,
2020-02-16 10:43:51 -08:00
} ,
] ,
default : 'visible' ,
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Category Names or IDs' ,
2020-02-16 10:43:51 -08:00
name : 'categories' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getCategories' ,
} ,
default : [ ] ,
2022-08-17 08:50:24 -07:00
description :
'List of categories. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Cross Sell IDs' ,
name : 'crossSellIds' ,
type : 'string' ,
default : '' ,
2022-04-22 09:29:51 -07:00
description : 'List of cross-sell products IDs. Multiple can be added separated by ,.' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Date On Sale From' ,
name : 'dateOnSaleFrom' ,
type : 'dateTime' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description : "Start date of sale price, in the site's timezone" ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Date On Sale To' ,
name : 'dateOnSaleTo' ,
type : 'dateTime' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description : "Ennd date of sale price, in the site's timezone" ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Description' ,
name : 'description' ,
type : 'string' ,
typeOptions : {
alwaysOpenEditWindow : true ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product description' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Downloadable' ,
name : 'downloadable' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether the product is downloadable' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'External URL' ,
name : 'externalUrl' ,
type : 'string' ,
default : '' ,
description : 'Product external URL. Only for external products.' ,
} ,
{
displayName : 'Featured' ,
name : 'featured' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether the product is featured' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Manage Stock' ,
name : 'manageStock' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
2020-02-16 10:43:51 -08:00
description : 'Stock management at product level' ,
} ,
{
displayName : 'Menu Order' ,
name : 'menuOrder' ,
type : 'number' ,
default : 1 ,
2022-05-06 14:01:25 -07:00
description : 'Menu order, used to custom sort products' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Parent ID' ,
name : 'parentId' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product parent ID' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Purchase Note' ,
name : 'purchaseNote' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Optional note to send the customer after purchase' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Regular Price' ,
name : 'regularPrice' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product regular price' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Reviews Allowed' ,
name : 'reviewsAllowed' ,
type : 'boolean' ,
default : true ,
2022-06-20 07:54:01 -07:00
description : 'Whether to allow reviews' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Sale Price' ,
name : 'salePrice' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product sale price' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Shipping Class' ,
name : 'shippingClass' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Shipping class slug' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Short Description' ,
name : 'shortDescription' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product short description' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'SKU' ,
name : 'sku' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Unique identifier' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Slug' ,
name : 'slug' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product slug' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Sold Individually' ,
name : 'soldIndividually' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether to allow one item to be bought in a single order' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Status' ,
name : 'status' ,
type : 'options' ,
options : [
{
name : 'Draft' ,
value : 'draft' ,
} ,
{
name : 'Pending' ,
value : 'pending' ,
} ,
{
name : 'Private' ,
value : 'private' ,
} ,
{
name : 'Publish' ,
value : 'publish' ,
} ,
] ,
default : 'publish' ,
2022-05-06 14:01:25 -07:00
description : 'A named status for the product' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Stock Quantity' ,
name : 'stockQuantity' ,
type : 'number' ,
default : 1 ,
} ,
{
displayName : 'Stock Status' ,
name : 'stockStatus' ,
type : 'options' ,
options : [
{
name : 'In Stock' ,
value : 'instock' ,
} ,
{
name : 'Out Of Stock' ,
value : 'outofstock' ,
} ,
{
name : 'On Back Order' ,
value : 'onbackorder' ,
} ,
] ,
default : 'instock' ,
description : 'Controls the stock status of the product' ,
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Tag Names or IDs' ,
2020-02-16 10:43:51 -08:00
name : 'tags' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getTags' ,
} ,
default : [ ] ,
2022-08-17 08:50:24 -07:00
description :
'List of tags. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Tax Class' ,
name : 'taxClass' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Tax Status' ,
name : 'taxStatus' ,
type : 'options' ,
options : [
{
name : 'Taxable' ,
value : 'taxable' ,
} ,
{
name : 'Shipping' ,
value : 'shipping' ,
} ,
{
name : 'None' ,
value : 'none' ,
} ,
] ,
default : 'taxable' ,
} ,
{
displayName : 'Type' ,
name : 'type' ,
type : 'options' ,
options : [
{
name : 'Simple' ,
value : 'simple' ,
} ,
{
name : 'Grouped' ,
value : 'grouped' ,
} ,
{
name : 'External' ,
value : 'external' ,
} ,
{
name : 'Variable' ,
value : 'variable' ,
} ,
] ,
default : 'simple' ,
description : 'Product type' ,
} ,
{
displayName : 'Upsell IDs' ,
name : 'upsellIds' ,
type : 'string' ,
default : '' ,
2022-04-22 09:29:51 -07:00
description : 'List of up-sell products IDs. Multiple can be added separated by ,.' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Virtual' ,
name : 'virtual' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether the product is virtual' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Weight' ,
name : 'weight' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product weight' ,
2020-02-16 10:43:51 -08:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Dimensions' ,
name : 'dimensionsUi' ,
placeholder : 'Add Dimension' ,
type : 'fixedCollection' ,
2022-04-22 09:29:51 -07:00
default : { } ,
2020-02-16 10:43:51 -08:00
typeOptions : {
multipleValues : false ,
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'product' ] ,
operation : [ 'create' ] ,
2020-02-16 10:43:51 -08:00
} ,
} ,
description : 'Product dimensions' ,
options : [
{
name : 'dimensionsValues' ,
displayName : 'Dimension' ,
values : [
{
displayName : 'Height' ,
name : 'height' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product height' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Length' ,
name : 'length' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product length' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Width' ,
name : 'width' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product width' ,
2020-02-16 10:43:51 -08:00
} ,
] ,
} ,
] ,
} ,
{
displayName : 'Images' ,
name : 'imagesUi' ,
placeholder : 'Add Image' ,
type : 'fixedCollection' ,
2022-04-22 09:29:51 -07:00
default : { } ,
2020-02-16 10:43:51 -08:00
typeOptions : {
multipleValues : true ,
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'product' ] ,
operation : [ 'create' ] ,
2020-02-16 10:43:51 -08:00
} ,
} ,
description : 'Product Image' ,
options : [
{
name : 'imagesValues' ,
displayName : 'Image' ,
values : [
{
displayName : 'Alt' ,
name : 'alt' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Image alternative text' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Src' ,
name : 'src' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Image URL' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Image name' ,
2020-02-16 10:43:51 -08:00
} ,
] ,
} ,
] ,
} ,
{
displayName : 'Metadata' ,
name : 'metadataUi' ,
placeholder : 'Add Metadata' ,
type : 'fixedCollection' ,
2022-04-22 09:29:51 -07:00
default : { } ,
2020-02-16 10:43:51 -08:00
typeOptions : {
multipleValues : true ,
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'product' ] ,
operation : [ 'create' ] ,
2020-02-16 10:43:51 -08:00
} ,
} ,
description : 'Meta data' ,
options : [
{
name : 'metadataValues' ,
displayName : 'Metadata' ,
values : [
{
displayName : 'Key' ,
name : 'key' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Name of the metadata key to add' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Value to set for the metadata key' ,
2020-02-16 10:43:51 -08:00
} ,
] ,
} ,
] ,
} ,
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* product:update */
/* -------------------------------------------------------------------------- */
2020-02-16 10:43:51 -08:00
{
displayName : 'Product ID' ,
name : 'productId' ,
type : 'string' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'product' ] ,
operation : [ 'update' ] ,
2020-02-16 10:43:51 -08:00
} ,
} ,
default : '' ,
} ,
{
displayName : 'Update Fields' ,
name : 'updateFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'product' ] ,
operation : [ 'update' ] ,
2020-02-16 10:43:51 -08:00
} ,
} ,
options : [
{
displayName : 'Backorders' ,
name : 'backorders' ,
type : 'options' ,
options : [
{
name : 'No' ,
value : 'no' ,
} ,
{
name : 'Notify' ,
value : 'notify' ,
} ,
{
name : 'Yes' ,
value : 'yes' ,
} ,
] ,
default : 'no' ,
description : 'If managing stock, this controls if backorders are allowed' ,
} ,
{
displayName : 'Button Text' ,
name : 'buttonText' ,
type : 'string' ,
default : '' ,
description : 'Product external button text. Only for external products.' ,
} ,
{
displayName : 'Catalog Visibility' ,
name : 'catalogVisibility' ,
type : 'options' ,
options : [
{
name : 'Visible' ,
value : 'visible' ,
} ,
{
name : 'Catalog' ,
value : 'catalog' ,
} ,
{
name : 'Search' ,
value : 'search' ,
} ,
{
name : 'Hidden' ,
value : 'hidden' ,
} ,
] ,
default : 'visible' ,
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Category Names or IDs' ,
2020-02-16 10:43:51 -08:00
name : 'categories' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getCategories' ,
} ,
default : [ ] ,
2022-08-17 08:50:24 -07:00
description :
'List of categories. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Cross Sell IDs' ,
name : 'crossSellIds' ,
type : 'string' ,
default : '' ,
2022-04-22 09:29:51 -07:00
description : 'List of cross-sell products IDs. Multiple can be added separated by ,.' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Date On Sale From' ,
name : 'dateOnSaleFrom' ,
type : 'dateTime' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description : "Start date of sale price, in the site's timezone" ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Date On Sale To' ,
name : 'dateOnSaleTo' ,
type : 'dateTime' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description : "Ennd date of sale price, in the site's timezone" ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Description' ,
name : 'description' ,
type : 'string' ,
typeOptions : {
alwaysOpenEditWindow : true ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product description' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Downloadable' ,
name : 'downloadable' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether the product is downloadable' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'External URL' ,
name : 'externalUrl' ,
type : 'string' ,
default : '' ,
description : 'Product external URL. Only for external products.' ,
} ,
{
displayName : 'Featured' ,
name : 'featured' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether the product is featured' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Manage Stock' ,
name : 'manageStock' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
2020-02-16 10:43:51 -08:00
description : 'Stock management at product level' ,
} ,
{
displayName : 'Menu Order' ,
name : 'menuOrder' ,
type : 'number' ,
default : 1 ,
2022-05-06 14:01:25 -07:00
description : 'Menu order, used to custom sort products' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product name' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Parent ID' ,
name : 'parentId' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product parent ID' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Purchase Note' ,
name : 'purchaseNote' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Optional note to send the customer after purchase' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Regular Price' ,
name : 'regularPrice' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product regular price' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Reviews Allowed' ,
name : 'reviewsAllowed' ,
type : 'boolean' ,
default : true ,
2022-06-20 07:54:01 -07:00
description : 'Whether to allow reviews' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Sale Price' ,
name : 'salePrice' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product sale price' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Shipping Class' ,
name : 'shippingClass' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Shipping class slug' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Short Description' ,
name : 'shortDescription' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product short description' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'SKU' ,
name : 'sku' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Unique identifier' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Slug' ,
name : 'slug' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product slug' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Sold Individually' ,
name : 'soldIndividually' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether to allow one item to be bought in a single order' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Status' ,
name : 'status' ,
type : 'options' ,
options : [
{
name : 'Draft' ,
value : 'draft' ,
} ,
{
name : 'Pending' ,
value : 'pending' ,
} ,
{
name : 'Private' ,
value : 'private' ,
} ,
{
name : 'Publish' ,
value : 'publish' ,
} ,
] ,
default : 'publish' ,
2022-05-06 14:01:25 -07:00
description : 'A named status for the product' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Stock Quantity' ,
name : 'stockQuantity' ,
type : 'number' ,
default : 1 ,
} ,
{
displayName : 'Stock Status' ,
name : 'stockStatus' ,
type : 'options' ,
options : [
{
name : 'In Stock' ,
value : 'instock' ,
} ,
{
name : 'Out Of Stock' ,
value : 'outofstock' ,
} ,
{
name : 'On Back Order' ,
value : 'onbackorder' ,
} ,
] ,
default : 'instock' ,
description : 'Controls the stock status of the product' ,
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Tag Names or IDs' ,
2020-02-16 10:43:51 -08:00
name : 'tags' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getTags' ,
} ,
default : [ ] ,
2022-08-17 08:50:24 -07:00
description :
'List of tags. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Tax Class' ,
name : 'taxClass' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Tax Status' ,
name : 'taxStatus' ,
type : 'options' ,
options : [
{
name : 'Taxable' ,
value : 'taxable' ,
} ,
{
name : 'Shipping' ,
value : 'shipping' ,
} ,
{
name : 'None' ,
value : 'none' ,
} ,
] ,
default : 'taxable' ,
} ,
{
displayName : 'Type' ,
name : 'type' ,
type : 'options' ,
options : [
{
name : 'Simple' ,
value : 'simple' ,
} ,
{
name : 'Grouped' ,
value : 'grouped' ,
} ,
{
name : 'External' ,
value : 'external' ,
} ,
{
name : 'Variable' ,
value : 'variable' ,
} ,
] ,
default : 'simple' ,
description : 'Product type' ,
} ,
{
displayName : 'Upsell IDs' ,
name : 'upsellIds' ,
type : 'string' ,
default : '' ,
2022-04-22 09:29:51 -07:00
description : 'List of up-sell products IDs. Multiple can be added separated by ,.' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Virtual' ,
name : 'virtual' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether the product is virtual' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Weight' ,
name : 'weight' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product weight' ,
2020-02-16 10:43:51 -08:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Dimensions' ,
name : 'dimensionsUi' ,
placeholder : 'Add Dimension' ,
type : 'fixedCollection' ,
2022-04-22 09:29:51 -07:00
default : { } ,
2020-02-16 10:43:51 -08:00
typeOptions : {
multipleValues : false ,
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'product' ] ,
operation : [ 'update' ] ,
2020-02-16 10:43:51 -08:00
} ,
} ,
description : 'Product dimensions' ,
options : [
{
name : 'dimensionsValues' ,
displayName : 'Dimension' ,
values : [
{
displayName : 'Height' ,
name : 'height' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product height' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Length' ,
name : 'length' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product length' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Width' ,
name : 'width' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Product width' ,
2020-02-16 10:43:51 -08:00
} ,
] ,
} ,
] ,
} ,
{
displayName : 'Images' ,
name : 'imagesUi' ,
placeholder : 'Add Image' ,
type : 'fixedCollection' ,
2022-04-22 09:29:51 -07:00
default : { } ,
2020-02-16 10:43:51 -08:00
typeOptions : {
multipleValues : true ,
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'product' ] ,
operation : [ 'update' ] ,
2020-02-16 10:43:51 -08:00
} ,
} ,
description : 'Product Image' ,
options : [
{
name : 'imagesValues' ,
displayName : 'Image' ,
values : [
{
displayName : 'Alt' ,
name : 'alt' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Image alternative text' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Src' ,
name : 'src' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Image URL' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Image name' ,
2020-02-16 10:43:51 -08:00
} ,
] ,
} ,
] ,
} ,
{
displayName : 'Metadata' ,
name : 'metadataUi' ,
placeholder : 'Add Metadata' ,
type : 'fixedCollection' ,
2022-04-22 09:29:51 -07:00
default : { } ,
2020-02-16 10:43:51 -08:00
typeOptions : {
multipleValues : true ,
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'product' ] ,
operation : [ 'update' ] ,
2020-02-16 10:43:51 -08:00
} ,
} ,
description : 'Meta data' ,
options : [
{
name : 'metadataValues' ,
displayName : 'Metadata' ,
values : [
{
displayName : 'Key' ,
name : 'key' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Name of the metadata key to add' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Value to set for the metadata key' ,
2020-02-16 10:43:51 -08:00
} ,
] ,
} ,
] ,
} ,
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* product:get */
/* -------------------------------------------------------------------------- */
2020-02-16 10:43:51 -08:00
{
displayName : 'Product ID' ,
name : 'productId' ,
type : 'string' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'product' ] ,
operation : [ 'get' ] ,
2020-02-16 10:43:51 -08:00
} ,
} ,
default : '' ,
} ,
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* product:getAll */
/* -------------------------------------------------------------------------- */
2020-02-16 10:43:51 -08:00
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'product' ] ,
operation : [ 'getAll' ] ,
2020-02-16 10:43:51 -08:00
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'product' ] ,
operation : [ 'getAll' ] ,
returnAll : [ false ] ,
2020-02-16 10:43:51 -08:00
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 100 ,
} ,
default : 50 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Options' ,
name : 'options' ,
type : 'collection' ,
placeholder : 'Add Option' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'product' ] ,
operation : [ 'getAll' ] ,
2020-02-16 10:43:51 -08:00
} ,
} ,
options : [
{
displayName : 'After' ,
name : 'after' ,
type : 'dateTime' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Limit response to resources published after a given ISO8601 compliant date' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Before' ,
name : 'before' ,
type : 'dateTime' ,
default : '' ,
description : 'Limit response to resources published before a given ISO8601 compliant date' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Category Name or ID' ,
2020-02-16 10:43:51 -08:00
name : 'category' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getCategories' ,
} ,
2022-08-17 08:50:24 -07:00
description :
'Limit result set to products assigned a specific category ID. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Context' ,
name : 'context' ,
type : 'options' ,
options : [
{
name : 'View' ,
value : 'view' ,
} ,
{
name : 'Embed' ,
value : 'embed' ,
} ,
{
name : 'Edit' ,
value : 'edit' ,
} ,
] ,
default : 'view' ,
2022-05-06 14:01:25 -07:00
description : 'Scope under which the request is made; determines fields present in response' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Featured' ,
name : 'featured' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether to limit the result set to featured products' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Max Price' ,
name : 'maxPrice' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Limit result set to products based on a maximun price' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Min Price' ,
name : 'minPrice' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Limit result set to products based on a minimum price' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Order' ,
name : 'order' ,
type : 'options' ,
options : [
{
name : 'ASC' ,
value : 'asc' ,
} ,
{
name : 'DESC' ,
value : 'desc' ,
} ,
] ,
default : 'desc' ,
2022-05-06 14:01:25 -07:00
description : 'Order sort attribute ascending or descending' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Order By' ,
name : 'orderBy' ,
type : 'options' ,
options : [
{
name : 'Date' ,
value : 'date' ,
} ,
{
name : 'ID' ,
value : 'id' ,
} ,
{
name : 'Include' ,
value : 'include' ,
} ,
{
name : 'Slug' ,
value : 'slug' ,
} ,
{
name : 'Title' ,
value : 'title' ,
} ,
] ,
default : 'id' ,
2022-05-06 14:01:25 -07:00
description : 'Sort collection by object attribute' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Search' ,
name : 'search' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Limit results to those matching a string' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'SKU' ,
name : 'sku' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Limit result set to products with a specific SKU' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Slug' ,
name : 'slug' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Limit result set to products with a specific slug' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Status' ,
name : 'status' ,
type : 'options' ,
options : [
2022-06-03 10:23:49 -07:00
{
name : 'Any' ,
value : 'any' ,
} ,
2020-02-16 10:43:51 -08:00
{
name : 'Draft' ,
value : 'draft' ,
} ,
{
name : 'Pending' ,
value : 'pending' ,
} ,
{
name : 'Private' ,
value : 'private' ,
} ,
{
name : 'Publish' ,
value : 'publish' ,
} ,
] ,
default : 'any' ,
2022-05-06 14:01:25 -07:00
description : 'Limit result set to products assigned a specific status' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Stock Status' ,
name : 'stockStatus' ,
type : 'options' ,
options : [
{
name : 'In Stock' ,
value : 'instock' ,
} ,
{
name : 'Out Of Stock' ,
value : 'outofstock' ,
} ,
{
name : 'On Back Order' ,
value : 'onbackorder' ,
} ,
] ,
default : '' ,
description : 'Controls the stock status of the product' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Tag Name or ID' ,
2020-02-16 10:43:51 -08:00
name : 'tag' ,
type : 'options' ,
default : [ ] ,
typeOptions : {
loadOptionsMethod : 'getTags' ,
} ,
2022-08-17 08:50:24 -07:00
description :
'Limit result set to products assigned a specific tag ID. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-02-16 10:43:51 -08:00
} ,
{
displayName : 'Tax Class' ,
name : 'taxClass' ,
type : 'options' ,
options : [
{
name : 'Standar' ,
value : 'standard' ,
} ,
{
name : 'Reduced Rate' ,
value : 'reduced-rate' ,
} ,
{
name : 'Zero Rate' ,
value : 'zero-rate.' ,
} ,
] ,
default : '' ,
description : 'Limit result set to products with a specific tax class' ,
} ,
{
displayName : 'Type' ,
name : 'type' ,
type : 'options' ,
options : [
{
name : 'Simple' ,
value : 'simple' ,
} ,
{
name : 'Grouped' ,
value : 'grouped' ,
} ,
{
name : 'External' ,
value : 'external' ,
} ,
{
name : 'Variable' ,
value : 'variable' ,
} ,
] ,
default : 'simple' ,
description : 'Product type' ,
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-16 10:43:51 -08:00
} ,
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* product:delete */
/* -------------------------------------------------------------------------- */
2020-02-16 10:43:51 -08:00
{
displayName : 'Product ID' ,
name : 'productId' ,
type : 'string' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'product' ] ,
operation : [ 'delete' ] ,
2020-02-16 10:43:51 -08:00
} ,
} ,
default : '' ,
} ,
2021-12-03 00:44:16 -08:00
] ;