We need to create a script that creates product attributes.
Product attribute comes from third-party API when creating a product attributes its checks attribute is available or not.
If that is not available then it creates at that time product attributes. Thank you!
2 Answers 2
yes I have got a solution for creating attributes using script and API
create attribute using Magento 2 default API
http://127.0.0.1/magento2/rest/all/V1/products/attributescheck attributes available or not using API
http://127.0.0.1/magento2/api/Product/ProductAttribute/Options/{attribute_id}get attribute id from attribute code using rest API
http://127.0.0.1/magento2/rest/all/v1/products/attributes/{attributecode}
Follow the following steps
- Log in to Admin Panel
- Navigate to Stores > Attributes > Product
- Click "Add New Attribute"
Fill-up the required details and save it, after that assign that attribute, specific attribute set.
-
I need to create a script not need to create a manual attribute from the adminViral Patel– Viral Patel2021年05月11日 05:28:06 +00:00Commented May 11, 2021 at 5:28
-
As you have mentioned it you don't want to create it using install data, so use upgrade data.Ashwini Sharma– Ashwini Sharma2021年05月16日 16:53:19 +00:00Commented May 16, 2021 at 16:53
-
I have mentioned Script it means need to create programmatically.Viral Patel– Viral Patel2021年05月26日 05:20:11 +00:00Commented May 26, 2021 at 5:20