Again I Spent quiet time to set `Use Default Value` in Magento.
I wanted to set Product Status to be `Use Default Value` under store views. I tried some methods and checked not lucky for me so i tested with the database.
SELECT * FROM catalog_product_entity_int WHERE store_id =4 and entity_id =1
I found when we enable `Use Default Value` there is a record for status (my status id was 96. You can find them from eav_attribute table )
When it is disabled there is no record. So i thought do that by Database wise. But its not good at all so I found this. Finally it worked.
I wanted to set Product Status to be `Use Default Value` under store views. I tried some methods and checked not lucky for me so i tested with the database.
SELECT * FROM catalog_product_entity_int WHERE store_id =4 and entity_id =1
I found when we enable `Use Default Value` there is a record for status (my status id was 96. You can find them from eav_attribute table )
When it is disabled there is no record. So i thought do that by Database wise. But its not good at all so I found this. Finally it worked.
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); $product = Mage::getModel('catalog/product') ->load($pro_id) ->setStoreId($store_view) ->setData('status', false) ->save();
You can use `Use Default Value` to supported attributes but don't forget to add
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
Otherwise only putting
setData('status', false);
won't work
Comments
Post a Comment