' ], ], 'date_on_sale_to_gmt' => [ 'description' => __( 'End date of sale price, as GMT.', 'dokan-lite' ), 'type' => 'date-time', 'context' => [ 'view', 'edit' ], ], 'price_html' => [ 'description' => __( 'Price formatted in HTML.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'on_sale' => [ 'description' => __( 'Shows if the product is on sale.', 'dokan-lite' ), 'type' => 'boolean', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'purchasable' => [ 'description' => __( 'Shows if the product can be bought.', 'dokan-lite' ), 'type' => 'boolean', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'total_sales' => [ 'description' => __( 'Amount of sales.', 'dokan-lite' ), 'type' => 'integer', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'virtual' => [ 'description' => __( 'If the product is virtual.', 'dokan-lite' ), 'type' => 'boolean', 'default' => false, 'context' => [ 'view', 'edit' ], ], 'downloadable' => [ 'description' => __( 'If the product is downloadable.', 'dokan-lite' ), 'type' => 'boolean', 'default' => false, 'context' => [ 'view', 'edit' ], ], 'downloads' => [ 'description' => __( 'List of downloadable files.', 'dokan-lite' ), 'type' => 'array', 'context' => [ 'view', 'edit' ], 'items' => [ 'type' => 'object', 'properties' => [ 'id' => [ 'description' => __( 'File MD5 hash.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'name' => [ 'description' => __( 'File name.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], ], 'file' => [ 'description' => __( 'File URL.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], ], ], ], ], 'download_limit' => [ 'description' => __( 'Number of times downloadable files can be downloaded after purchase.', 'dokan-lite' ), 'type' => 'integer', 'default' => - 1, 'context' => [ 'view', 'edit' ], ], 'download_expiry' => [ 'description' => __( 'Number of days until access to downloadable files expires.', 'dokan-lite' ), 'type' => 'integer', 'default' => - 1, 'context' => [ 'view', 'edit' ], ], 'external_url' => [ 'description' => __( 'Product external URL. Only for external products.', 'dokan-lite' ), 'type' => 'string', 'format' => 'uri', 'context' => [ 'view', 'edit' ], ], 'button_text' => [ 'description' => __( 'Product external button text. Only for external products.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], ], 'tax_status' => [ 'description' => __( 'Tax status.', 'dokan-lite' ), 'type' => 'string', 'default' => 'taxable', 'enum' => [ 'taxable', 'shipping', 'none' ], 'context' => [ 'view', 'edit' ], ], 'tax_class' => [ 'description' => __( 'Tax class.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], ], 'manage_stock' => [ 'description' => __( 'Stock management at product level.', 'dokan-lite' ), 'type' => 'boolean', 'default' => false, 'context' => [ 'view', 'edit' ], ], 'stock_quantity' => [ 'description' => __( 'Stock quantity.', 'dokan-lite' ), 'type' => 'integer', 'context' => [ 'view', 'edit' ], ], 'in_stock' => [ 'description' => __( 'Controls whether or not the product is listed as "in stock" or "out of stock" on the frontend.', 'dokan-lite' ), 'type' => 'boolean', 'default' => true, 'context' => [ 'view', 'edit' ], ], 'backorders' => [ 'description' => __( 'If managing stock, this controls if backorders are allowed.', 'dokan-lite' ), 'type' => 'string', 'default' => 'no', 'enum' => [ 'no', 'notify', 'yes' ], 'context' => [ 'view', 'edit' ], ], 'backorders_allowed' => [ 'description' => __( 'Shows if backorders are allowed.', 'dokan-lite' ), 'type' => 'boolean', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'backordered' => [ 'description' => __( 'Shows if the product is on backordered.', 'dokan-lite' ), 'type' => 'boolean', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'sold_individually' => [ 'description' => __( 'Allow one item to be bought in a single order.', 'dokan-lite' ), 'type' => 'boolean', 'default' => false, 'context' => [ 'view', 'edit' ], ], 'weight' => [ /* translators: %s: weight unit */ 'description' => sprintf( __( 'Product weight (%s).', 'dokan-lite' ), $weight_unit ), 'type' => 'string', 'context' => [ 'view', 'edit' ], ], 'dimensions' => [ 'description' => __( 'Product dimensions.', 'dokan-lite' ), 'type' => 'object', 'context' => [ 'view', 'edit' ], 'properties' => [ 'length' => [ /* translators: %s: dimension unit */ 'description' => sprintf( __( 'Product length (%s).', 'dokan-lite' ), $dimension_unit ), 'type' => 'string', 'context' => [ 'view', 'edit' ], ], 'width' => [ /* translators: %s: dimension unit */ 'description' => sprintf( __( 'Product width (%s).', 'dokan-lite' ), $dimension_unit ), 'type' => 'string', 'context' => [ 'view', 'edit' ], ], 'height' => [ /* translators: %s: dimension unit */ 'description' => sprintf( __( 'Product height (%s).', 'dokan-lite' ), $dimension_unit ), 'type' => 'string', 'context' => [ 'view', 'edit' ], ], ], ], 'shipping_required' => [ 'description' => __( 'Shows if the product need to be shipped.', 'dokan-lite' ), 'type' => 'boolean', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'shipping_taxable' => [ 'description' => __( 'Shows whether or not the product shipping is taxable.', 'dokan-lite' ), 'type' => 'boolean', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'shipping_class' => [ 'description' => __( 'Shipping class slug.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], ], 'shipping_class_id' => [ 'description' => __( 'Shipping class ID.', 'dokan-lite' ), 'type' => 'integer', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'reviews_allowed' => [ 'description' => __( 'Allow reviews.', 'dokan-lite' ), 'type' => 'boolean', 'default' => true, 'context' => [ 'view', 'edit' ], ], 'average_rating' => [ 'description' => __( 'Reviews average rating.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'rating_count' => [ 'description' => __( 'Amount of reviews that the product have.', 'dokan-lite' ), 'type' => 'integer', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'related_ids' => [ 'description' => __( 'List of related products IDs.', 'dokan-lite' ), 'type' => 'array', 'items' => [ 'type' => 'integer', ], 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'upsell_ids' => [ 'description' => __( 'List of up-sell products IDs.', 'dokan-lite' ), 'type' => 'array', 'items' => [ 'type' => 'integer', ], 'context' => [ 'view', 'edit' ], ], 'cross_sell_ids' => [ 'description' => __( 'List of cross-sell products IDs.', 'dokan-lite' ), 'type' => 'array', 'items' => [ 'type' => 'integer', ], 'context' => [ 'view', 'edit' ], ], 'parent_id' => [ 'description' => __( 'Product parent ID.', 'dokan-lite' ), 'type' => 'integer', 'context' => [ 'view', 'edit' ], ], 'purchase_note' => [ 'description' => __( 'Optional note to send the customer after purchase.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], ], 'categories' => [ 'description' => __( 'List of categories.', 'dokan-lite' ), 'type' => 'array', 'context' => [ 'view', 'edit' ], 'items' => [ 'type' => 'object', 'properties' => [ 'id' => [ 'description' => __( 'Category ID.', 'dokan-lite' ), 'type' => 'integer', 'context' => [ 'view', 'edit' ], ], 'name' => [ 'description' => __( 'Category name.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'slug' => [ 'description' => __( 'Category slug.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], ], ], ], 'tags' => [ 'description' => __( 'List of tags.', 'dokan-lite' ), 'type' => 'array', 'context' => [ 'view', 'edit' ], 'items' => [ 'type' => 'object', 'properties' => [ 'id' => [ 'description' => __( 'Tag ID.', 'dokan-lite' ), 'type' => 'integer', 'context' => [ 'view', 'edit' ], ], 'name' => [ 'description' => __( 'Tag name.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'slug' => [ 'description' => __( 'Tag slug.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], ], ], ], 'images' => [ 'description' => __( 'List of images.', 'dokan-lite' ), 'type' => 'array', 'context' => [ 'view', 'edit' ], 'items' => [ 'type' => 'object', 'properties' => [ 'id' => [ 'description' => __( 'Image ID.', 'dokan-lite' ), 'type' => 'integer', 'context' => [ 'view', 'edit' ], ], 'date_created' => [ 'description' => __( "The date the image was created, in the site's timezone.", 'dokan-lite' ), 'type' => 'date-time', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'date_created_gmt' => [ 'description' => __( 'The date the image was created, as GMT.', 'dokan-lite' ), 'type' => 'date-time', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'date_modified' => [ 'description' => __( "The date the image was last modified, in the site's timezone.", 'dokan-lite' ), 'type' => 'date-time', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'date_modified_gmt' => [ 'description' => __( 'The date the image was last modified, as GMT.', 'dokan-lite' ), 'type' => 'date-time', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'src' => [ 'description' => __( 'Image URL.', 'dokan-lite' ), 'type' => 'string', 'format' => 'uri', 'context' => [ 'view', 'edit' ], ], 'name' => [ 'description' => __( 'Image name.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], ], 'alt' => [ 'description' => __( 'Image alternative text.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], ], 'position' => [ 'description' => __( 'Image position. 0 means that the image is featured.', 'dokan-lite' ), 'type' => 'integer', 'context' => [ 'view', 'edit' ], ], ], ], ], 'attributes' => [ 'description' => __( 'List of attributes.', 'dokan-lite' ), 'type' => 'array', 'context' => [ 'view', 'edit' ], 'items' => [ 'type' => 'object', 'properties' => [ 'id' => [ 'description' => __( 'Attribute ID.', 'dokan-lite' ), 'type' => 'integer', 'context' => [ 'view', 'edit' ], ], 'name' => [ 'description' => __( 'Attribute name.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], ], 'position' => [ 'description' => __( 'Attribute position.', 'dokan-lite' ), 'type' => 'integer', 'context' => [ 'view', 'edit' ], ], 'visible' => [ 'description' => __( "Define if the attribute is visible on the \"Additional information\" tab in the product's page.", 'dokan-lite' ), 'type' => 'boolean', 'default' => false, 'context' => [ 'view', 'edit' ], ], 'variation' => [ 'description' => __( 'Define if the attribute can be used as variation.', 'dokan-lite' ), 'type' => 'boolean', 'default' => false, 'context' => [ 'view', 'edit' ], ], 'options' => [ 'description' => __( 'List of available term names of the attribute.', 'dokan-lite' ), 'type' => 'array', 'context' => [ 'view', 'edit' ], 'items' => [ 'type' => 'string', ], ], ], ], ], 'default_attributes' => [ 'description' => __( 'Defaults variation attributes.', 'dokan-lite' ), 'type' => 'array', 'context' => [ 'view', 'edit' ], 'items' => [ 'type' => 'object', 'properties' => [ 'id' => [ 'description' => __( 'Attribute ID.', 'dokan-lite' ), 'type' => 'integer', 'context' => [ 'view', 'edit' ], ], 'name' => [ 'description' => __( 'Attribute name.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], ], 'option' => [ 'description' => __( 'Selected attribute term name.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], ], ], ], ], 'variations' => [ 'description' => __( 'List of variations IDs.', 'dokan-lite' ), 'type' => 'array', 'context' => [ 'view', 'edit' ], 'items' => [ 'type' => 'integer', ], 'readonly' => true, ], 'grouped_products' => [ 'description' => __( 'List of grouped products ID.', 'dokan-lite' ), 'type' => 'array', 'items' => [ 'type' => 'integer', ], 'context' => [ 'view', 'edit' ], ], 'menu_order' => [ 'description' => __( 'Menu order, used to custom sort products.', 'dokan-lite' ), 'type' => 'integer', 'context' => [ 'view', 'edit' ], ], 'meta_data' => [ 'description' => __( 'Meta data.', 'dokan-lite' ), 'type' => 'array', 'context' => [ 'view', 'edit' ], 'items' => [ 'type' => 'object', 'properties' => [ 'id' => [ 'description' => __( 'Meta ID.', 'dokan-lite' ), 'type' => 'integer', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'key' => [ 'description' => __( 'Meta key.', 'dokan-lite' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], ], 'value' => [ 'description' => __( 'Meta value.', 'dokan-lite' ), 'type' => 'mixed', 'context' => [ 'view', 'edit' ], ], ], ], ], ], ]; return $this->add_additional_fields_schema( $schema ); } }