Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <pre><?php
- include 'app/Mage.php';
- Mage::app();
- Mage::app()->setCurrentStore(0);
- $confs = Mage::getResourceModel('catalog/product_collection')
- ->addAttributeToFilter('type_id','configurable');
- $prods = array();
- foreach ($confs as $conf) {
- $simps = Mage::getModel('catalog/product_type_configurable')
- ->getUsedProducts(null, $conf);
- foreach ($simps as $simp) {
- if ($simp->getVisibility() != 1) {
- echo $simp->getId() . " : " . $simp->getVisibility() . "\n";
- $prods[] = $simp->getId();
- }
- }
- }
- Mage::getSingleton('catalog/product_action')->updateAttributes(
- $prods,
- array("visibility" => 1),
- 0
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement