Support » Plugin: WooCommerce » Fetch all products of a category (Woo REST API)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support kellymetal a11n

    (@kellymetal)

    Hi there,

    To fetch all products in a certain category, you will want to use the products API with the category parameter:

    
    /wp-json/wc/v3/products?category=ID
    

    Replace ID with the ID of your category. This is in the documentation here:
    https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-products

    I hope that helps!

    Why would this not be possible with a slug? You may not have access to the ID all the time?

    @kellymetal its not working
    its return this
    Observable {_isScalar: false, source: Observable, operator: MapOperator}
    operator: MapOperator
    project: (res) => res.body
    arguments: (…)
    caller: (…)
    length: 1
    name: “”
    __proto__: ƒ ()
    FunctionLocation: http.js:1129
    Scopes: Scopes[2]
    thisArg: undefined
    __proto__:
    call: ƒ call(subscriber, source)
    constructor: class MapOperator
    __proto__: Object
    source: Observable
    operator: FilterOperator
    predicate: (event) => event instanceof HttpResponse
    thisArg: undefined
    __proto__: Object
    source: Observable
    operator: MergeMapOperator {concurrent: 1, project: ƒ}
    source: Observable {_isScalar: false, _subscribe: ƒ}
    _isScalar: false
    __proto__: Object
    _isScalar: false
    __proto__: Object
    _isScalar: false
    __proto__: Object

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fetch all products of a category (Woo REST API)’ is closed to new replies.