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

    Interface WooCommerceProductVariant

    Individual product response format from WooCommerce API when requesting a single product. Extends SearchResponseItem with variation-specific information.

    interface WooCommerceProductVariant {
        matchPercentage: number;
        _id?: number;
        parentProduct?: { title: string; url: string; permalink?: string };
        priceSeriesKey?: string;
        priceTrendValue?: number;
        id: number;
        name: string;
        type: string;
        description: string;
        short_description: string;
        average_rating: string;
        review_count: number;
        permalink: string;
        is_in_stock?: boolean;
        sold_individually: boolean;
        sku: string;
        prices: {
            price: string;
            regular_price: string;
            sale_price: string;
            price_range?: WooCommercePriceRange;
            currency_code: string;
            currency_symbol: string;
            currency_minor_unit: number;
            currency_decimal_separator: string;
            currency_thousand_separator: string;
            currency_prefix: string;
            currency_suffix: string;
        };
        price_html: string;
        categories?: { id: number; name: string; slug: string; link: string }[];
        attributes: {
            id: number;
            name: string;
            taxonomy: string;
            has_variations: boolean;
            terms: { id: number; name: string; slug: string }[];
        }[];
        variations: { id: number; attributes: { name: string; value: string }[] }[];
        add_to_cart?: { text?: string; description?: string; url?: string };
        tags?: string[];
        is_purchasable?: null | boolean;
        is_on_backorder?: null | boolean;
        low_stock_remaining?: null | boolean;
        stock_availability?: { text: string; class: string };
        weight: null | string;
        formatted_weight: null | string;
        images: {
            id: number;
            src: string;
            thumbnail: string;
            srcset: string;
            sizes: string;
            thumbnail_srcset: string;
            thumbnail_sizes: string;
            name: string;
            alt: string;
        }[];
        variation: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    matchPercentage: number

    Match percentage of the product title and the search string

    95
    
    _id?: number

    Positional index of the product within the current search-results list, assigned at render/persist time. This is NOT a stable product identifier (that is id) — it only conveys row position, so consumers that need a unique row key can use it without clobbering the real product id.

    0
    
    parentProduct?: { title: string; url: string; permalink?: string }

    Display-only back-reference to the main product, set on flattened variant rows when the "group product variants" setting is off (see flattenProductVariants). Lets the detail panel link back to the parent instead of listing variants. Never set by suppliers, never persisted or exported.

    priceSeriesKey?: string

    Display-only price-history series id for this row, stamped on flattened variant rows when the "group product variants" setting is off (see flattenProductVariants). Because flattening merges the variant onto a copy of the product and drops variants, the row can no longer recompute its own variantSeriesKey; carrying the resolved key lets the results table look up the variant's recorded series directly. Never set by suppliers, never persisted or exported.

    priceTrendValue?: number

    Display-only signed percent change of this row's price trend (rising = +, falling = −), stamped by the results table so its trend column has a value to sort by (price history isn't on the row — it's loaded separately). Absent when the row has no drawable trend. Never set by suppliers, never persisted or exported.

    id: number

    Unique identifier for the product

    name: string

    Name of the product

    type: string

    Type of product (e.g., 'simple', 'variable', 'grouped')

    description: string

    Full HTML description of the product

    short_description: string

    Brief HTML description of the product

    average_rating: string

    Average rating for the product

    review_count: number

    Number of reviews for the product

    permalink: string

    URL to the product's page on the store

    is_in_stock?: boolean

    Whether the product is currently in stock

    sold_individually: boolean

    Whether the product can only be bought one at a time

    sku: string

    Stock keeping unit - unique product identifier

    prices: {
        price: string;
        regular_price: string;
        sale_price: string;
        price_range?: WooCommercePriceRange;
        currency_code: string;
        currency_symbol: string;
        currency_minor_unit: number;
        currency_decimal_separator: string;
        currency_thousand_separator: string;
        currency_prefix: string;
        currency_suffix: string;
    }

    Detailed pricing information for the product

    Type declaration

    • price: string

      Current price of the product

    • regular_price: string

      Regular price before any sales

    • sale_price: string

      Sale price if the product is on sale

    • Optionalprice_range?: WooCommercePriceRange

      Price range of the product

    • currency_code: string

      ISO currency code (e.g., 'USD', 'EUR')

    • currency_symbol: string

      Currency symbol (e.g., '$', '€')

    • currency_minor_unit: number

      Number of decimal places for the currency

    • currency_decimal_separator: string

      Character used as decimal separator

    • currency_thousand_separator: string

      Character used as thousands separator

    • currency_prefix: string

      Text to display before the price

    • currency_suffix: string

      Text to display after the price

    price_html: string

    Price HTML of the product

    categories?: { id: number; name: string; slug: string; link: string }[]

    Categories the product belongs to

    Type declaration

    • id: number

      Unique identifier for the category

    • name: string

      Display name of the category

    • slug: string

      URL-friendly version of the category name

    • link: string

      URL to the category page

    attributes: {
        id: number;
        name: string;
        taxonomy: string;
        has_variations: boolean;
        terms: { id: number; name: string; slug: string }[];
    }[]

    Product attributes and their possible values

    Type declaration

    • id: number

      Unique identifier for the attribute

    • name: string

      Display name of the attribute

    • taxonomy: string

      Taxonomy identifier for the attribute

    • has_variations: boolean

      Whether this attribute is used for product variations

    • terms: { id: number; name: string; slug: string }[]

      Possible values for this attribute

    variations: { id: number; attributes: { name: string; value: string }[] }[]

    Product variations if this is a variable product

    Type declaration

    • id: number

      Unique identifier for the variation

    • attributes: { name: string; value: string }[]

      Attributes that define this variation

    add_to_cart?: { text?: string; description?: string; url?: string }

    Add to cart button configuration

    Type declaration

    • Optionaltext?: string

      Button text

    • Optionaldescription?: string

      Button description

    • Optionalurl?: string

      URL to add the product to cart

    tags?: string[]

    Array of tag names associated with the product

    is_purchasable?: null | boolean

    Whether the product is purchasable

    is_on_backorder?: null | boolean

    Whether the product is on backorder

    low_stock_remaining?: null | boolean

    Low stock remaining

    stock_availability?: { text: string; class: string }

    Stock availability

    Type declaration

    • text: string

      Text description of the stock availability

    • class: string

      Class name of the stock availability

    weight: null | string

    Weight of the product

    formatted_weight: null | string

    Formatted weight of the product

    images: {
        id: number;
        src: string;
        thumbnail: string;
        srcset: string;
        sizes: string;
        thumbnail_srcset: string;
        thumbnail_sizes: string;
        name: string;
        alt: string;
    }[]

    Images of the product

    Type declaration

    • id: number

      Unique identifier for the image

    • src: string

      URL of the image

    • thumbnail: string

      Thumbnail URL of the image

    • srcset: string

      Srcset of the image

    • sizes: string

      Sizes of the image

    • thumbnail_srcset: string

      Thumbnail srcset of the image

    • thumbnail_sizes: string

      Thumbnail sizes of the image

    • name: string

      Name of the image

    • alt: string

      Alt text of the image

    variation: string

    Variation identifier