Skip to main content
added 221 characters in body
Source Link
7ochem
  • 7.6k
  • 14
  • 52
  • 80

The event is being fired from core. You can disable this event observer in a custom module (rather then editing core files, which is evil ;) ). Put this in your app/code/local/(VendorName)/(ModuleName)/etc/config.xml:

<config>
    <frontend>
        <events>
            <catalog_controller_product_view>
                <observers>
                    <reports>
                        <type>disabled</type>
                    </reports>
                </observers>
            </catalog_controller_product_view>
        </events>
    </frontend>
</config>

The magic happens in merging your config.xml with the one from core that is defining this observer. Your XML overrides the core <type> node and sets the type to "disabled" which results in the event observer still being there, but not being fired.

Is there any downside to this (disabling viewed products counting)?

I can't think of any downside in disabling this other than that you can't see product view reports anymore...

Also see the answer by Fra here explaining how to disable reports completely (if you don't need them at all) and other Magento code that puts a load on your database.

The event is being fired from core. You can disable this event observer in a custom module (rather then editing core files, which is evil ;) ). Put this in your app/code/local/(VendorName)/(ModuleName)/etc/config.xml:

<config>
    <frontend>
        <events>
            <catalog_controller_product_view>
                <observers>
                    <reports>
                        <type>disabled</type>
                    </reports>
                </observers>
            </catalog_controller_product_view>
        </events>
    </frontend>
</config>

The magic happens in merging your config.xml with the one from core that is defining this observer. Your XML overrides the core <type> node and sets the type to "disabled" which results in the event observer still being there, but not being fired.

Is there any downside to this (disabling viewed products counting)?

I can't think of any downside in disabling this other than that you can't see product view reports anymore...

The event is being fired from core. You can disable this event observer in a custom module (rather then editing core files, which is evil ;) ). Put this in your app/code/local/(VendorName)/(ModuleName)/etc/config.xml:

<config>
    <frontend>
        <events>
            <catalog_controller_product_view>
                <observers>
                    <reports>
                        <type>disabled</type>
                    </reports>
                </observers>
            </catalog_controller_product_view>
        </events>
    </frontend>
</config>

The magic happens in merging your config.xml with the one from core that is defining this observer. Your XML overrides the core <type> node and sets the type to "disabled" which results in the event observer still being there, but not being fired.

Is there any downside to this (disabling viewed products counting)?

I can't think of any downside in disabling this other than that you can't see product view reports anymore...

Also see the answer by Fra here explaining how to disable reports completely (if you don't need them at all) and other Magento code that puts a load on your database.

Rollback to Revision 1
Source Link
7ochem
  • 7.6k
  • 14
  • 52
  • 80

The event is being fired from core. You can disable this event observer in a custom module (rather then editing core files, which is evil ;) ). Put this in your app/code/local/(VendorName)/(ModuleName)/etc/config.xml:

<config>
    <frontend>
        <events>
            <catalog_controller_product_view>
                <observers>
                    <reports>
                        <type>disabled</type>
                    </reports>
                </observers>
            </catalog_controller_product_view>
        </events>
    </frontend>
</config>

The magic happens in merging your config.xml with the one from core that is defining this observer. Your XML overrides the core <type> node and sets the type to "disabled" which results in the event observer still being there, but not being fired.

Is there any downside to this (disabling viewed products counting)?

I can't think of any downside in disabling this other than that you can't see product view reports anymore...

UPDATE Mage_Log_Model_Visitor also perform DB writing on every access through 2 different observer/methods: initByRequest() and saveByRequest()

Apparently Magento developers were aware by the risks, as you can see there is a filter in the constructor that check the user agent

 $ignoreAgents = $this->_config->getNode('global/ignore_user_agents');
        if ($ignoreAgents) {
            $ignoreAgents = $ignoreAgents->asArray();
            if (in_array($userAgent, $ignoreAgents)) {
                $this->_skipRequestLogging = true;
            }
        }

Anyway it filters only certain bot ...

 <global>
      ...
        <ignore_user_agents>
            <google1>Googlebot/1.0 ([email protected] http://googlebot.com/)</google1>
            <google2>Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)</google2>
            <google3>Googlebot/2.1 (+http://www.googlebot.com/bot.html)</google3>
        </ignore_user_agents>
 

The event is being fired from core. You can disable this event observer in a custom module (rather then editing core files, which is evil ;) ). Put this in your app/code/local/(VendorName)/(ModuleName)/etc/config.xml:

<config>
    <frontend>
        <events>
            <catalog_controller_product_view>
                <observers>
                    <reports>
                        <type>disabled</type>
                    </reports>
                </observers>
            </catalog_controller_product_view>
        </events>
    </frontend>
</config>

The magic happens in merging your config.xml with the one from core that is defining this observer. Your XML overrides the core <type> node and sets the type to "disabled" which results in the event observer still being there, but not being fired.

Is there any downside to this (disabling viewed products counting)?

I can't think of any downside in disabling this other than that you can't see product view reports anymore...

UPDATE Mage_Log_Model_Visitor also perform DB writing on every access through 2 different observer/methods: initByRequest() and saveByRequest()

Apparently Magento developers were aware by the risks, as you can see there is a filter in the constructor that check the user agent

 $ignoreAgents = $this->_config->getNode('global/ignore_user_agents');
        if ($ignoreAgents) {
            $ignoreAgents = $ignoreAgents->asArray();
            if (in_array($userAgent, $ignoreAgents)) {
                $this->_skipRequestLogging = true;
            }
        }

Anyway it filters only certain bot ...

 <global>
      ...
        <ignore_user_agents>
            <google1>Googlebot/1.0 ([email protected] http://googlebot.com/)</google1>
            <google2>Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)</google2>
            <google3>Googlebot/2.1 (+http://www.googlebot.com/bot.html)</google3>
        </ignore_user_agents>
 

The event is being fired from core. You can disable this event observer in a custom module (rather then editing core files, which is evil ;) ). Put this in your app/code/local/(VendorName)/(ModuleName)/etc/config.xml:

<config>
    <frontend>
        <events>
            <catalog_controller_product_view>
                <observers>
                    <reports>
                        <type>disabled</type>
                    </reports>
                </observers>
            </catalog_controller_product_view>
        </events>
    </frontend>
</config>

The magic happens in merging your config.xml with the one from core that is defining this observer. Your XML overrides the core <type> node and sets the type to "disabled" which results in the event observer still being there, but not being fired.

Is there any downside to this (disabling viewed products counting)?

I can't think of any downside in disabling this other than that you can't see product view reports anymore...

added 1058 characters in body
Source Link
Fra
  • 7k
  • 12
  • 65
  • 99

The event is being fired from core. You can disable this event observer in a custom module (rather then editing core files, which is evil ;) ). Put this in your app/code/local/(VendorName)/(ModuleName)/etc/config.xml:

<config>
    <frontend>
        <events>
            <catalog_controller_product_view>
                <observers>
                    <reports>
                        <type>disabled</type>
                    </reports>
                </observers>
            </catalog_controller_product_view>
        </events>
    </frontend>
</config>

The magic happens in merging your config.xml with the one from core that is defining this observer. Your XML overrides the core <type> node and sets the type to "disabled" which results in the event observer still being there, but not being fired.

Is there any downside to this (disabling viewed products counting)?

I can't think of any downside in disabling this other than that you can't see product view reports anymore...

UPDATE Mage_Log_Model_Visitor also perform DB writing on every access through 2 different observer/methods: initByRequest() and saveByRequest()

Apparently Magento developers were aware by the risks, as you can see there is a filter in the constructor that check the user agent

 $ignoreAgents = $this->_config->getNode('global/ignore_user_agents');
        if ($ignoreAgents) {
            $ignoreAgents = $ignoreAgents->asArray();
            if (in_array($userAgent, $ignoreAgents)) {
                $this->_skipRequestLogging = true;
            }
        }

Anyway it filters only certain bot ...

 <global>
      ...
        <ignore_user_agents>
            <google1>Googlebot/1.0 ([email protected] http://googlebot.com/)</google1>
            <google2>Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)</google2>
            <google3>Googlebot/2.1 (+http://www.googlebot.com/bot.html)</google3>
        </ignore_user_agents>
 

The event is being fired from core. You can disable this event observer in a custom module (rather then editing core files, which is evil ;) ). Put this in your app/code/local/(VendorName)/(ModuleName)/etc/config.xml:

<config>
    <frontend>
        <events>
            <catalog_controller_product_view>
                <observers>
                    <reports>
                        <type>disabled</type>
                    </reports>
                </observers>
            </catalog_controller_product_view>
        </events>
    </frontend>
</config>

The magic happens in merging your config.xml with the one from core that is defining this observer. Your XML overrides the core <type> node and sets the type to "disabled" which results in the event observer still being there, but not being fired.

Is there any downside to this (disabling viewed products counting)?

I can't think of any downside in disabling this other than that you can't see product view reports anymore...

The event is being fired from core. You can disable this event observer in a custom module (rather then editing core files, which is evil ;) ). Put this in your app/code/local/(VendorName)/(ModuleName)/etc/config.xml:

<config>
    <frontend>
        <events>
            <catalog_controller_product_view>
                <observers>
                    <reports>
                        <type>disabled</type>
                    </reports>
                </observers>
            </catalog_controller_product_view>
        </events>
    </frontend>
</config>

The magic happens in merging your config.xml with the one from core that is defining this observer. Your XML overrides the core <type> node and sets the type to "disabled" which results in the event observer still being there, but not being fired.

Is there any downside to this (disabling viewed products counting)?

I can't think of any downside in disabling this other than that you can't see product view reports anymore...

UPDATE Mage_Log_Model_Visitor also perform DB writing on every access through 2 different observer/methods: initByRequest() and saveByRequest()

Apparently Magento developers were aware by the risks, as you can see there is a filter in the constructor that check the user agent

 $ignoreAgents = $this->_config->getNode('global/ignore_user_agents');
        if ($ignoreAgents) {
            $ignoreAgents = $ignoreAgents->asArray();
            if (in_array($userAgent, $ignoreAgents)) {
                $this->_skipRequestLogging = true;
            }
        }

Anyway it filters only certain bot ...

 <global>
      ...
        <ignore_user_agents>
            <google1>Googlebot/1.0 ([email protected] http://googlebot.com/)</google1>
            <google2>Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)</google2>
            <google3>Googlebot/2.1 (+http://www.googlebot.com/bot.html)</google3>
        </ignore_user_agents>
 
Source Link
7ochem
  • 7.6k
  • 14
  • 52
  • 80
Loading