VPS business hosting starting at $29.95/24/7 premium technical support

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);

});

Author: Harshvardhan Malpani

PHP Developer based in New Delhi, India. Working as a freelance web developer providing server deployment, website development and maintenance services.

One thought on “Magento 2.1x – Add options in custom product attribute using backend”

Leave a Reply

Your email address will not be published.