0

I have a Simple product enter image description here

And a group product with that simple product enter image description here

Now, when I do next query

{
  products(filter: { url_key: { eq: "test-product-1" } }) {
    items {
      name
      sku
      url_key
      stock_status
      price_range {
        minimum_price {
          regular_price {
            value
            currency
          }
        }
      }
    }
    total_count
    page_info {
      page_size
    }
  }
}

I get two products, but I want get only simple product because I write it url_key.

{
  "data": {
    "products": {
      "total_count": 2,
      "items": [
        {
          "name": "Test group product",
          "sku": "tgp1",
          "url_key": "test-group-product",
          "price_range": {
            "minimum_price": {
              "regular_price": {
                "value": 99,
                "currency": "USD"
              }
            }
          }
        },
        {
          "name": "Test simple product 1",
          "sku": "tsp1",
          "url_key": "test-simple-product-1",
          "price_range": {
            "minimum_price": {
              "regular_price": {
                "value": 99,
                "currency": "USD"
              }
            }
          }
        }
      ],
      "page_info": {
        "page_size": 4,
        "current_page": 1
      }
    }

Please, say me. What I need to do to get only simple product when I write it url_key?

Maybe someone know why it works so?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.