Switching Between Configurable and Simple product structures

MagManager Script for Switching to Configurable Model - Works with product selection SQL

/* Look up the configurable products entered and change the visibility to C&S (4) */ UPDATE /*PREFIX*/catalog_product_entity_int SET value = 4 WHERE entity_id in (&`prod.SelProd`) AND attribute_id = (SELECT attribute_id FROM /*PREFIX*/eav_attribute WHERE attribute_code = "visibility") AND entity_id in (SELECT entity_id FROM /*PREFIX*/catalog_product_entity where type_id='configurable');/*DELIMITER*/ /* Look up the children of the configurable products entered and if they are simple change the visibility to NVI */ UPDATE /*PREFIX*/catalog_product_entity_int SET value = 1 WHERE entity_id in (SELECT product_id FROM bmm2_catalog_product_super_link WHERE parent_id in (&`prod.SelProd`)) AND attribute_id = (SELECT attribute_id FROM /*PREFIX*/eav_attribute WHERE attribute_code = "visibility") AND entity_id in (SELECT entity_id FROM /*PREFIX*/catalog_product_entity where type_id='simple');/*DELIMITER*/

 

MagManager Script for Switching to Simple Model - Works with product selection SQL

 

/* Look up the configurable products entered and change the visibility to Search (3) */ UPDATE /*PREFIX*/catalog_product_entity_int SET value = 3 WHERE entity_id in (&`prod.SelProd`) AND attribute_id = (SELECT attribute_id FROM /*PREFIX*/eav_attribute WHERE attribute_code = "visibility") AND entity_id in (SELECT entity_id FROM /*PREFIX*/catalog_product_entity where type_id='configurable');/*DELIMITER*/ /* Look up the children of the configurable products entered and if they are simple change the visibility to NVI */ UPDATE /*PREFIX*/catalog_product_entity_int SET value = 4 WHERE entity_id in (SELECT product_id FROM bmm2_catalog_product_super_link WHERE parent_id in (&`prod.SelProd`)) AND attribute_id = (SELECT attribute_id FROM /*PREFIX*/eav_attribute WHERE attribute_code = "visibility") AND entity_id in (SELECT entity_id FROM /*PREFIX*/catalog_product_entity where type_id='simple');/*DELIMITER*/