Documentation on Product Attribute input types

I’m building off of my previous post, however I feel that it’s different enough to warrant a new question.

I’ve set up my development environment in windows using xampp, and I’m working with Magento 2.3.5-p1 without the sample data.

I’m working on a script that will allow me to import a properly formatted CSV file and convert the data to product attributes that can be applied to various products.

I’ve found the devdocs on programmatically adding product attributes here, however I can’t seem to track down what 'input' => 'types' from the InstallData.php shown on that page are valid, or source and model files to use as templates for each input type. Any assistance on this front would be nice.

Also, will the database be ok if the 'type' => 'varchar', always remains varchar, or will inputs such as check-boxes require changing the datatype to booleans?

Below I’ve attached the progress I’ve made so you can get a better idea of what I’m trying to accomplish. Feel free to offer improvement suggestions, however I ask that you ignore the contents of $src_content as that was where I realized I can’t find the information I need to continue.

Finally, before anyone says anything about the security of this script, please know that this is being used on my local machine to automate the creation of 1300+ product attributes, and it will not be going live with the website.


I thought Reddit would act like stack exchange and make the code block scroll-able but I was wrong, so here’s a pastebin link.

submitted by /u/brother_Kirik
[link] [comments]