0

I'm using the Magento API to update Products for a store running Magento 2.2.5. I'm performing a simple update request containing a payload like this:

    {
  "product": {
    "extensionAttributes": {
      "stockItem": {
        "isInStock": false, 
        "qty": 0
      }
    }, 
    "sku": "9854112"
  }, 
  "saveOptions": true
}

to the Products endpoint Products endpoint e.g. /rest/V1/products/9854112.

The store owner has advised that after an update for the different store views the checkboxes to Use Default Value of a given field would be disabled. They referred me to this fix:

https://www.cadence-labs.com/2018/03/magento-2-use-default-value-store-view-scope-fix/

but after performing a Product update via the API the checkboxes are reverted again.

I can't see anything in the Product docs that would allow me to specify that the Use Default Value checkbox should remain checked - is this possible to achieve via the API when updating a Product? Or is there another way to prevent this from happening?

0

1 Answer 1

1

You can bypass this problem using n98-magerun. You can script it or using an observer and run eav:attributes:restore-use-default-value

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.