I can't think of the reason why this is happening. I have a custom module in a vagrant box, which works perfectly. When I migrate my code/database to an actual server, the magento event does not seem to fire. I put a tracer on dispatchEvent in Mage.php to prove that the event is firing, which it is. The custom module looking for that event doesn't seem to fire.

My code is as follows: /app/code/local/Company/collectBillToCode/Model/Observer.php

//fires after billing info is saved
class Company_collectBillToCode_Model_Observer{
    public function captureBillTo(Varien_Event_Observer $observer){

        //confirm this is an international order, and then collect the information as needed
            //save $billingInfo['bill-to'] to session so that it can be retreived by all components


Config.xml: /app/code/local/Company/collectBillToCode/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>

And the module: /app/etc/modules/Company_collectBillToCode.xml

<?xml version="1.0" encoding="UTF-8"?>

I have cleared caches, sessions, recompiled, reindexed permissions are set to www-data with 775. Instance is completely patched. My other custom module looking for a similar event controller_action_postdispatch_checkout_onepage_saveBilling DOES fire. I'm stumped. -_-

To be clear, this works 100% in my vagrant instance of magento, when I copy the code from git it stops working. What step is missing?!

3 Answers 3


I agree with Krishnan that this is likely related to capitalization.

Some of what you're doing here doesn't match Magento's standard practices. For instance, Company_collectBillToCode_Model should probably be Company_CollectBillToCode_Model and Company/collectBillToCode/Model/Observer.php should be Company/CollectBillToCode/Model/Observer.php, etc. I would recommend capitalizing Collect in all cases where there are any capitals.

You might also try removing all of the capitalizations after Collect and going from there.

  • I changed the capitalization as recommended up above, and the issue persists. I'm going to reiterate, this exact code is working in a Vagrant instance of magento but stops working in production. Commented Dec 7, 2016 at 22:02
  • I think that we understand that part of it. Different systems respond differently to capitalization. What else is different between these systems? Is the local.xml exactly the same between systems? (I'm thinking about differences in cache storage.)
    – Tyler V.
    Commented Dec 8, 2016 at 5:30
  • The files are exact copies. The OS is Ubuntu 14. Packages are completely the same. Both environments are completely up to date. I even spun up a new environment manually (virtual box) and ran into the same issue. This code only works in Vagrant. It's so baffling to me. Commented Dec 8, 2016 at 14:17

Try this

<observers> <company_collectbilltocode> <class>Company_collectBillToCode_Model_Observer</class> <method>captureBillTo</method> <company_collectbilltocode> </observers>
  • Did not resolve. I have other modules with the same lowercase structure that function without issue. I did try what you suggested though. Commented Dec 7, 2016 at 19:57
  • Also, this did not resolve. Commented Dec 7, 2016 at 20:45

So after all of that work. Here's what happened:

Git, doesn't recognize file/folder name changes if the change is capitalization. I pushed my changes into git, not realizing that the code that I modified did actually commit to the git repo.

When I changed collectBillToCode to CollectBillToCode git didn't see the naming changes, it only saw the file changes.

My workaround was, remove the directory, commit to git, push to git. Add the directory again, commit to git, push to git.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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