How to update product attribute code in magento
$installer = $this;
$installer->startSetup();
$installer->updateAttribute('catalog_product', 'old_attribute_code', array('attribute_code' => 'new_attribute_code'));
$installer->endSetup();
Script:
<?php
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$write->query("
UPDATE eav_attribute val
SET val.attribute_code = "SET VALUE WHAT YOU WANT"
WHERE val.attribute_id = (
SELECT attribute_id FROM eav_attribute eav
WHERE eav.entity_type_id = 4
AND eav.attribute_code = 'your-product-attribute-code'
)
");
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home