Tuesday, May 31, 2011

Disabling customer logging

All the tables that start with 'log_' become pretty big after some uptime.
If you don't need these here is a solution to disable them.
[UPDATE]
It seams that the product compare feature is based on this logging. If you disable all the logging you won't be able to compare products. This is a big no-no Magento Team. (see the logging methods marked in the xml below)
[/UPDATE] Create your own Magento extension. Let's call it 'Custom_Log'.
For this you need to create in app/code/local the folder 'Custom' and inside it the folder 'Log'.
Each module needs a config file.
Create inside the 'Log' folder a folder named 'etc' and inside it a file called config.xml with this content:
<?xml version="1.0"?>
<config>
    <modules>
         <Custom_Log>
            <version>0.0.1</version>
        </Custom_Log>
    </modules>
    <frontend>
 <!-- [+] Disable logging -->
   <events>
            <controller_action_predispatch><!--disabling this will 'kill' the product compare-->
                <observers>
                    <log>
                        <type>disabled</type>
                    </log>
                </observers>
            </controller_action_predispatch>
            <controller_action_postdispatch><!--disabling this will 'kill' the product compare-->
                <observers>
                    <log>
                        <type>disabled</type>
                    </log>
                </observers>
            </controller_action_postdispatch>
            <customer_login>
                <observers>
                    <log>
                        <type>disabled</type>
                    </log>
                </observers>
            </customer_login>
            <customer_logout>
                <observers>
                    <log>
                        <type>disabled</type>
                    </log>
                </observers>
            </customer_logout>
            <sales_quote_save_after>
                <observers>
                    <log>
                        <type>disabled</type>
                    </log>
                </observers>
            </sales_quote_save_after>
            <checkout_quote_destroy>
                <observers>
                    <log>
                        <type>disabled</type>
                    </log>
                </observers>
            </checkout_quote_destroy>
        </events>
   <!-- [-] Disable logging -->
    </frontend>
</config>

now you need to tell Magento to use your module.
In app/etc/modules create the file 'Custom_Log.xml' with this content:
<?xml version="1.0"?>
<config>
    <modules>
        <Custom_Log>
            <active>true</active>
            <codePool>local</codePool>
        </Custom_Log>
    </modules>
</config>

now just clear the cache (contents of folder var/cache) and you are done.
The downside of doing this is that you won't get any details of the customers visits. But you can live with that. There's Google Analytics for this.

New design

Based on the visitor suggestions (if they were needed) I decided to change the design of this 'so called blog' to a 'less ugly one'.
I hope this is more readable.

Magento extensions you would like to see or to improuve

Hello everyone.
I decided to make a list and a poll (I hope it's still active when you read this) of extensions that people would like to see or to have perfected.

Here is the the short list I came up with.
Save a product as pdf
Tree like sitemap
Live chat
Yahoo weather widget
Multilanguage FAQ (with categories)
Product accessories
Price based on dimensions (WxHxD)
Multi-language e-mail templates

If you have any other ideas please put them here and maybe you will get that extension.

Please do not suggest online payment extensions.

Marius.