Magento 2.1x – Add options in custom product attribute using backend

Go to the attribute edit page using magento 2 admin panel (Stores > Attributes > Product > Edit attribute)
Use console – ctrl + shift + J
Edit the js array mimim and then paste the following code in console.

$jq=new jQuery.noConflict();
var mimim=["Black","Blue","Blue Black"];
$jq.each(mimim,function(a,b){
$jq("#add_new_option_button").click();
$jq("#manage-options-panel tbody tr:last-child td:nth-child(3) input").val(b);

});

Posted

in

, ,

by

Comments

One response to “Magento 2.1x – Add options in custom product attribute using backend”

  1. […] This is an update to my previous script which was used to add custom product attribute values using backend – Add values to product attribute […]

Leave a Reply

Your email address will not be published. Required fields are marked *