The first thing I do when starting a project is ask the client if he needs user logs in his website. In technical terms Mage_Log module. In all the cases so far I got the answer:

No. We will use Google Analytics.

And the next question is "Do you want compare products?". I ask these questions because the log tables tend to become large overtime, and the website gets slow. So I want to avoid fixing speed issues.

The second question I ask is because the compare products section depends on the logs for guest customers. See this in the addAction of the product compare controller:

 if ($productId
        && (Mage::getSingleton('log/visitor')->getId() || Mage::getSingleton('customer/session')->isLoggedIn())

So if the client want's compare products I cannot disable the logging.
I mean I could search for an extension or build one, but the real question is: Why is the compare functionality linked to the visitor id? Any good outcome of this?. The guest quotes function nicely by referencing the id of the quote in the session. Why not the same for compare products?

  • Probably because no one would disable any part of Magento, ever project uses every part right ;) – David Manners Jul 31 '14 at 10:41
  • As long as someone implemented the possibility to disable a core module I don't think this is the reason...but I get the joke :). – Marius Jul 31 '14 at 10:42
  • Agreed, though I have seen other parts that do not play nicely after disabling some extensions. In short that is why I do not really get why people love composer and Magento cause to me it feels odd as you cannot reliably split the core modules. – David Manners Jul 31 '14 at 11:00
  • @DavidManners. Hopefully this will be possible to some degree on 2.0. – Marius Jul 31 '14 at 11:01
  • so back to the question what would happen if you disabled the module but then set up your own module with config for log/visitor that worked with session information? Never tried it myself – David Manners Jul 31 '14 at 11:10

As it stands I would say that this question is somewhat unanswerable - the reason that it uses the log tables is because it does. I really don't think that there was much rationale other than to say that Mage_Log has been present since 0.6B and that early efforts may have been to hook initial functionality on it; after some time the limitations probably came to light and they stopped developing on that idea.

This really can only be answered fully by someone like Boris but I'm fairly confident that the answer to "why did you do it that way" will be "because we did it that way."

| improve this answer | |
  • 1
    A "because we did it that way" answer is better than a "because ef you" answer. I guess you are right, this is unanswerable. I was hoping for a core developer answer. I will accept this answer mainly because someone realized this is wrong and decided to change it in Magento2. github.com/magento/magento2/issues/536 – Marius Aug 20 '14 at 14:15
  • You are correct. Original lack of experience with modularity consequences on early stages of development, and more importantly lack of time to revisit and rewrite existing code that already "works" – Unirgy Aug 20 '14 at 20:44

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.