Magento: Cannot Override Sales Rule

I cannot override the model of sales rules. I want to override the Mage_SalesRule_Model_Rule class .

Here is my code: -

<?xml version="1.0"?>
<config>
    <modules>
        <MyNamespace_MyModule>
            <version>0.1.0</version>
        </MyNamespace_MyModule>
    </modules>
    <global>
        <models>
            <salesrule>
                <rewrite>
                    <rule>MyNamespace_MyModule_Model_Rule</rule>
                </rewrite>
            </salesrule>
        </models>
    </global>
</config>

But that does not work.

Any help please?

0
source share
1 answer

Thanks to everyone for helping me debug my problem.

Now the problem is resolved.

I wrote the override code in another local module XML file. However, I noticed that the code and my cache are disabled. But I do not know how this caused problems. So, when I deleted this commented code (from another module), my problem was resolved and I was able to override the salesrule model.

, . .

  • , XML .
  • , (System → Configuration → Advanced).
  • , . , "", .
  • , , :

    echo get_class(Mage::getModel('salesrule/rule'));

.

+3

Source: https://habr.com/ru/post/1753743/


All Articles