1

I tried to observe a quantity change event but I messed up with the config file a bit

config.xml:

    <events>
        <cataloginventory_stock_item_save_after >
            <observers>
                <unreal_bisn>
                    <class>unreal_bisn/observer</class>
                    <method>productBackInStock</method>
                </unreal_bisn>
            </observers>
        </cataloginventory_stock_item_save_after >
    </events>

Model/Observer.php

<?php

class Unreal_Bisn_Model_Observer
{

    public function productBackInStock()
    {
        die("Worked");
    }

}

When I change the qty of a product I see a warning that shows me I did a wrong configuration of namespaces somehow

Warning: include(Mage\Unreal\Bisn\Model\Observer.php): 

It should be

Unreal\Bisn\Model\Observer.php

Please let me know what to adjust.

thanks

2

Have you set the model?

<global>
     <models>
          <unreal_bisn><class>Unreal_Bisn_Model</class></unreal_bisn>
     </models>
</global>

Also, I can't remember if you'll break/confuse things using <unreal_bisn> inside <observer>, I'd use <unreal_bisn_observer> for that.

  • weee thanks! I did not have had the model, I'll accept the answer as soon as I can – xhallix Nov 20 '15 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.