Magento api update product attribute
If so how is that done? If so, what would be the API endpoint? Go to Solution. I finally got it to update the MSRP. For whatever reason, it would not update until I only passed in the custom attribute in the payload.
You were correct in that when it is successful it returns the product JSON. View solution in original post. Hey joled , You can use following API endpoint for update a product usign sku. I hope it will help you! Thanks so much for the suggestion. M1 Certified. I am still facing this issue in M2.
Anybody found solution to this yet? I am facing the same issue in magento v2. Frequent Contributor. Hello gelanivishal Can u give me proper solution? I am facing same issue in Magento 2. Thanks Magento Developer Ankita Biswas. Occasional Contributor. Use saveAttribute method to save custom product attribute. While this may technically work, the code you have written is just about the last way you should do this. In Magento, you really should be using the models provided by the code and not write database queries on your own.
In your case, if you need to update attributes for 1 or many products, there is a way for you to do that very quickly and pretty safely. This code is responsible for updating all the product IDs you want, only the changed attributes for any single store at a time. The first parameter is basically an array of Product IDs.
If you only want to update a single product, just put it in an array. The second parameter is an array that contains the attributes you want to update for the given products. Then finally, the third and final attribute is the store ID you want these updates to happen to. Most likely this number will either be 1 or 0.
I would play around with this function call and use this instead of writing and maintaining your own database queries. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Asked 3 years ago. Active 3 years ago. Viewed 2k times. Thank you. Improve this question.
0コメント