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
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_operatortag+tag_operatorbrand+brand_operatorThe companion WooCommerce POS API PR currently adds server-side support for
brandandbrand_operator, but does not yet add custom REST support forcategory_operatorortag_operator. If WooCommerce REST products ignores those params, client-side$andtaxonomy 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,andtag_operator:in,not_in,andbrand_operator:in,not_in,and_unstable_tax_[product-taxonomy]_unstable_tax_[product-taxonomy]_operatorDocs: https://developer.woocommerce.com/docs/apis/store-api/resources-endpoints/products/
Requirements
category_operatorandtag_operatorif WC REST does not already support them.category_operator=and|not_inandtag_operator=and|not_in._unstable_tax_[product-taxonomy]parity is needed for custom product taxonomies.Related PRs