The perfect solution for this is to develop an Event-Observer module using the controller_action_postdispatch_adminhtml_catalog_product_save
event which is fired on product save. Your Observer.php
will then update the product's popularity
, like this:
app/code/local/Namespace/Module/etc/config.xml
:
...
<adminhtml>
<events>
<controller_action_postdispatch_adminhtml_catalog_product_save>
<observers>
<namespace_module>
<type>singleton</type>
<class>Namespace_Module_Model_Observer</class>
<method>updatePopularity</method>
</namespace_module>
</observers>
</controller_action_postdispatch_adminhtml_catalog_product_save>
</events>
</adminhtml>
And then in app/code/local/Namespace/Module/Model/Observer.php
:
public function updatePopularity($observer){
$product = $observer->getEvent()->getProduct();
$product->setPopularity(100);
$product->save();
}
Then you should be all set.