Example for how to create product variation types programmatically.
Source code viewer
// Load array with empty variables for the new product type. $product_type = commerce_product_ui_product_type_new(); // Overwrite empty defaults. 'is_new' => TRUE, 'type' => 'model_' . $id, 'name' => 'Model ' . $id, 'revision' => 0, ) + $product_type; // Write the product type to the database. commerce_product_ui_product_type_save($product_type); // Set the multilingual value for the product type if entity translation is enabled. if (module_exists('entity_translation')) { variable_set('language_product_type_' . $product_type['type'], $product_type['multilingual']); } Programming Language: PHP