i want to copy a product's attribute (weight) to another atribute (general_weight).
i found this codes, but i don't know what to do with this codes? or where to copy them?
$prod=Mage::getModel('catalog/product')->load($id);
$val=$prod->getData('attribute_code');
assign the values to another attribute of that product with this code
$prod->setAttreibuteCode($val);
$prod->save();
i will thankful if you experts help me and explain by details.
** i want weight attribute value to be copied into general_weight always on product save.
Best Answer
Moh3n,i suggest that export an product from Admin in csv format. with sku,weight and then import that csv with change columns name to general_weight from weight.
pragmatically if want then follow below process:
Update:
Create an script at magento root
update.php
and put the below code :then run the script by browser or shell php program.