Convert dropdown attribute to text swatch in Magento2 Admin Panel

Run the following code in console: $=new jQuery.noConflict(); $("#swatch-text-options-panel tr td:nth-child(4) input").each(function (e,el) { $(this).parent().parent().find("td:nth-child(3) input").val($(this).val());});

September 24, 2019 · 1 min · Harshvardhan Malpani

Understanding “this” keyword in JavaScript.

‘Hi Everyone! In this article, we are about to discuss **‘this’**keyword in JavaScript. It is a very important part of object-oriented JS programming. Hence it becomes crucial for serious developers to understand **‘this’**keyword. It is also one of the most confused concepts of JavaScript. What is ‘this’? Understanding 'this': To be able to understand what I am about to talk, you should be familiar with the basics of JavaScript. e.x – Variables, Objects, Functions, etc… ...

December 15, 2018 · 3 min · Harshvardhan Malpani

Bulk Add Custom Attribute Options in Magento 1

$jq=new jQuery.noConflict(); var mimim=["Yellow Topaz", "Alexandrite"]; $jq.each(mimim,function(a,b){ $jq("#add_new_option_button").click(); $jq("#matage-options-panel .dynamic-grid tbody tr:nth-child(2) td:nth-child(1) input").val(b); });

May 16, 2018 · 1 min · Harshvardhan Malpani

How to manage Magento 2 product attribute values options using console

This is an update to my previous script which was used to add custom product attribute values using backend – Add values to product attribute Read the previous^ part to get introduction about how it works. you will have to use browser console (ctrl + shift +j in Google chrome) First of all initialize the array mimim with the final set of values you want to see in backend. The script then automatically removes the extra options first(values which are not in mimim but in present in backend), then it adds the remaining values from mimim (which are in mimim but not at backend) ...

November 22, 2017 · 1 min · Harshvardhan Malpani