I am creating a new custom product attribute and I would like it should by default be populated with the product name value that I can change it to something else later. Can I do this in magentos admin panel? If not how do i execute a script to do this for me. thanks!!
1 Answer 1
To set a specific value in a product attribute you can use a backend model. In this backend model it is possible to check if the attribute is empty to update and set the product name as value. If it's not empty no action is done. This will only work if you save all the products again. An other solution is to use the afterLoad of the backend model and add the same check there.
See http://magebase.com/magento-tutorials/using-a-backend-model-to-customize-magento-a-tip-from-magento-developers-paradise/ for more details about using a backend_model with an attribute.
catalog_prdouct_save_before, and check if product is new. If it is new, you can create value in your attribute with the product title. Just a brief solution.