У меня небольшая проблема с переопределением базового класса Magento: Core / Rule / Model / Rule.php.Я думаю, что все делаю правильно, но код просто не работает (ничего не меняется).
My [namespace] /Rule/etc/config.xml:
<?xml version="1.0"?>
<config>
<modules>
<[namespace]_Rule>
<version>0.1.0</version>
</[namespace]_Rule>
</modules>
<global>
<models>
<rule>
<rewrite>
<rule>[namespace]_Rule_Model_Rule</rule>
</rewrite>
</rule>
</models>
</global>
</config>
Мой [namespace] /Rule/Model/Rule.php:
class [namespace]_Rule_Model_Rule extends Mage_Rule_Model_Rule
{
protected function _beforeSave()
{
if ($this->getConditions()) {
$this->setConditionsSerialized(serialize($this->getConditions()->asArray()));
$this->unsConditions();
}
if ($this->getActions()) {
$this->setActionsSerialized(serialize($this->getActions()->asArray()));
$this->unsActions();
}
$this->_prepareWebsiteIds();
if (is_array($this->getCustomerGroupIds())) {
$this->setCustomerGroupIds(join(',', $this->getCustomerGroupIds()));
}
parent::_beforeSave();
}
Мое приложение / etc / [namespace] _All.xml:
<?xml version="1.0"?>
<config>
<modules>
<[namespace]_Rule>
<active>true</active>
<codePool>local</codePool>
</[namespace]_Rule>
</modules>
</config>
Буду очень признателен за помощь.