I need to set a new value to a custom product attribute.
I want this to happen when a new product is created. The default value of the attribute is 0, I need to set it to 1.
I have an event observer for catalog_product_load_after.
<?xml version="1.0"?>
<config>
<modules>
<Schott_ShowQuoteAtZero>
<version>1.0.0</version>
</Schott_ShowQuoteAtZero>
</modules>
<global>
<events>
<catalog_product_load_after>
<observers>
<Schott_ShowQuoteAtZero_Observer>
<type>model</type>
<class>schott_showquoteatzero/observer</class>
<method>showQuoteButtonAtZeroPrice</method>
</Schott_ShowQuoteAtZero_Observer>
</observers>
</catalog_product_load_after>
</events>
</global>
</config>
Here is my observer
class Schott_ShowQuoteAtZero_Model_Observer
{
public function showQuoteButtonAtZeroPrice(Varien_Event_Observer $observer)
{
$product = $observer->getEvent()->getProduct();
$product->setData('quotemode_conditions',1);
$product->save();
}
}
It does not change the attribute value. Can anyone help?