ChemPal Documentation - v1.6.0
    Preparing search index...

    Type Alias WooCommerceProductSearchParams

    type WooCommerceProductSearchParams = {
        context?: "view" | "edit" | "embed";
        page?: number;
        per_page?: number;
        search?: string;
        slug?: string;
        after?: string;
        before?: string;
        date_column?: "date" | "date_gmt" | "modified" | "modified_gmt";
        exclude?: number[];
        include?: number[];
        offset?: number;
        order?: "asc" | "desc";
        orderby?:
            | "date"
            | "modified"
            | "id"
            | "include"
            | "title"
            | "slug"
            | "price"
            | "popularity"
            | "rating"
            | "menu_order"
            | "comment_count";
        parent?: number[];
        parent_exclude?: number[];
        type?: "simple"
        | "variable"
        | "grouped"
        | "external"
        | "variation";
        sku?: string;
        featured?: boolean;
        category?: string;
        category_operator?: "in" | "not_in" | "and";
        brand?: string;
        brand_operator?: "in" | "not_in" | "and";
        tag?: string;
        tag_operator?: "in" | "not_in" | "and";
        on_sale?: boolean;
        min_price?: string;
        max_price?: string;
        stock_status?: ("instock" | "outofstock" | "onbackorder")[];
        attributes?: {
            attribute: string;
            term_id: number;
            slug?: string[];
            operator?: "in" | "not_in" | "and";
        }[];
        attribute_relation?: "and"
        | "in";
        catalog_visibility?: "any" | "visible" | "catalog" | "search" | "hidden";
        rating?: (1 | 2 | 3 | 4 | 5)[];
        related?: number;
    }
    Index

    Properties

    context?: "view" | "edit" | "embed"

    Scope under which the request is made; determines fields present in response.

    page?: number

    Current page of the collection.

    per_page?: number

    Maximum number of items to be returned in result set.

    search?: string

    Limit results to those matching a string.

    slug?: string

    Limit result set to products with specific slug(s). Use commas to separate.

    after?: string

    Limit response to resources published after a given ISO8601 compliant date.

    before?: string

    Limit response to resources published before a given ISO8601 compliant date.

    date_column?: "date" | "date_gmt" | "modified" | "modified_gmt"

    Column to use for ordering results.

    exclude?: number[]

    Exclude products with specific IDs.

    include?: number[]

    Include products with specific IDs.

    offset?: number

    Offset the result set by a specific number of items.

    order?: "asc" | "desc"

    Order sort attribute ascending or descending.

    orderby?:
        | "date"
        | "modified"
        | "id"
        | "include"
        | "title"
        | "slug"
        | "price"
        | "popularity"
        | "rating"
        | "menu_order"
        | "comment_count"

    Sort collection by object attribute.

    parent?: number[]

    Limit result set to products with specific parent IDs.

    parent_exclude?: number[]

    Exclude products with specific parent IDs.

    type?: "simple" | "variable" | "grouped" | "external" | "variation"

    Limit result set to products with specific type.

    sku?: string

    Limit result set to products with specific SKU.

    featured?: boolean

    Limit result set to featured products.

    category?: string

    Limit result set to products with specific category.

    category_operator?: "in" | "not_in" | "and"

    Operator to use for category filtering.

    brand?: string

    Limit result set to products with specific brand.

    brand_operator?: "in" | "not_in" | "and"

    Operator to use for brand filtering.

    tag?: string

    Limit result set to products with specific tag.

    tag_operator?: "in" | "not_in" | "and"

    Operator to use for tag filtering.

    on_sale?: boolean
    min_price?: string

    Limit result set to products with minimum price.

    max_price?: string

    Limit result set to products with maximum price.

    stock_status?: ("instock" | "outofstock" | "onbackorder")[]
    attributes?: {
        attribute: string;
        term_id: number;
        slug?: string[];
        operator?: "in" | "not_in" | "and";
    }[]

    Limit result set to products with specific attributes.

    Type declaration

    • attribute: string

      Attribute name.

    • term_id: number

      Term ID.

    • Optionalslug?: string[]

      Limit result set to products with specific slug.

    • Optionaloperator?: "in" | "not_in" | "and"

      Operator to use for attribute filtering.

    attribute_relation?: "and" | "in"

    Relation between attributes.

    catalog_visibility?: "any" | "visible" | "catalog" | "search" | "hidden"

    Catalog visibility.

    rating?: (1 | 2 | 3 | 4 | 5)[]

    Limit result set to products with specific rating.

    related?: number

    Limit result set to products with specific related ID.