4

All I found so far is from the User Guide in Step 4 under 2.:

The Quantity is determined by the product variations, so you can leave it blank for now.

The Stock Status of a configurable product is determined by each associated configuration. Because the product was saved without entering a quantity, the Stock Status is now set to “Out of Stock.”

According to this the Quantity is determined by the product variations but how about the Stock Status? If you have variations that are "In Stock" shouldn't be the configurable "In Stock" too?

My background:
Our products are created via rest api like this:

  1. All simples
  2. The configurables with the simple ids that belong to them in configurable_product_links

In our case all configurables are set to "Out of Stock". Even when I reindex the Stock Status is not getting updated. Is this expected behavior?

I've already tried:

  • Clearing cache
  • Reindexing

Here an example json we post to create a configurable:

{
  "product": {
    "typeId": "configurable",
    "sku": "sku",
    "status": 1,
    "attributeSetId": 44,
    "name": "Configurable product name",
    "extensionAttributes": {
      "configurable_product_options": [
        {
          "attribute_id": 861,
          "label": "Some Label",
          "values": [
            {
              "value_index": 15929
            },
            {
              "value_index": 15945
            },
            {
              "value_index": 15967
            }
          ]
        }
      ],
      "configurable_product_links": [
        18449,
        18450,
        18451
      ],
      "category_links": [
        {
          "position": 0,
          "category_id": 899
        }
      ]
    },
    "customAttributes": [
      {
        "attributeCode": "description",
        "value": "Our description"
      }
    ]
  }
}
  • 1
    did you check child products? they are on stock? 18449,18450,18451 ??? – alexey boltynov May 3 at 11:25
  • for them Manage Stock is disabled could that be the reason? – Daniel May 3 at 11:34
  • of course yes, because configurable products don`t show individually, they are depends on child products stocks – alexey boltynov May 3 at 11:53
  • makes sense I didn't take that into account – Daniel May 3 at 12:04
  • do it, it will help you , I`ll be happy! – alexey boltynov May 3 at 12:10
1

Try to create the configurable product with manage_stock=false it will works as expected!

  • 1
    This works indeed. I just think that this is a little inconsistent from Magento because if the Manage Stock is false it doesn't mean it is Out of Stock especially when the variants have a Quantity >0 – Daniel May 3 at 13:41

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.