Skip to content

Mirror Store API product taxonomy operators in WCPOS REST #1074

@kilbot

Description

@kilbot

Follow-up from wcpos/monorepo#513 and #1072.

Context

The app-side query translator now mirrors Woo Store API taxonomy filter names for product filters:

  • category + category_operator
  • tag + tag_operator
  • brand + brand_operator

The companion WooCommerce POS API PR currently adds server-side support for brand and brand_operator, but does not yet add custom REST support for category_operator or tag_operator. If WooCommerce REST products ignores those params, client-side $and taxonomy semantics may not be honored server-side.

Goal

Mirror Woo Store API product taxonomy filter behavior in the WCPOS REST products endpoint until WooCommerce REST adds native support.

Relevant Store API params documented by WooCommerce:

  • category_operator: in, not_in, and
  • tag_operator: in, not_in, and
  • brand_operator: in, not_in, and
  • _unstable_tax_[product-taxonomy]
  • _unstable_tax_[product-taxonomy]_operator

Docs: https://developer.woocommerce.com/docs/apis/store-api/resources-endpoints/products/

Requirements

  • Add WCPOS REST support for category_operator and tag_operator if WC REST does not already support them.
  • Keep the same future-proofing pattern used for brand: if parent WooCommerce REST adds native support later, defer to the parent and avoid duplicate tax queries.
  • Confirm whether WooCommerce REST already supports any of these operator params in the installed Woo version.
  • Add PHPUnit coverage for category_operator=and|not_in and tag_operator=and|not_in.
  • Consider whether _unstable_tax_[product-taxonomy] parity is needed for custom product taxonomies.

Related PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions