getAttribute('catalog_product', 'price_type'); $taxClassAttribute = $installer->getAttribute('catalog_product', 'tax_class_id'); $productTable = $installer->getTable('catalog/product'); $priceTypeTable = $productTable ."_". $priceTypeAttribute['backend_type']; $taxClassTable = $productTable ."_". $taxClassAttribute['backend_type']; $db = $installer->getConnection(); $db->beginTransaction(); try { // select bundle product ids with dynamic price $select = $db->select() ->from(array('attr' => $priceTypeTable), 'attr.entity_id') ->joinLeft(array('e' => $productTable), 'attr.entity_id = e.entity_id', '') ->where('attr.attribute_id = ?', $priceTypeAttribute['attribute_id']) ->where('e.type_id = ?', 'bundle') ->where('attr.value = ?', 0); $isDataChanged = false; $stmt = $db->query($select); // set "None" tax class attribute for bundles with dynamic price while ($row = $stmt->fetch()) { $data = array('value' => 0); $where = array( 'attribute_id = ?' => $taxClassAttribute['attribute_id'], 'entity_id = ?' => $row['entity_id'] ); $count = $db->update($taxClassTable, $data, $where); if ($count > 0) { $isDataChanged = true; } } // set "Require Reindex" status for some indexes if attributes data has been modified if ($isDataChanged) { $indexerCodes = array( 'catalog_product_attribute', 'catalog_product_price', 'catalog_product_flat' ); $indexer = Mage::getModel('index/process'); foreach ($indexerCodes as $code) { $indexer->load($code, 'indexer_code') ->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX); } } $db->commit(); } catch (Exception $e) { $db->rollback(); throw $e; }