Archive for the ‘Magento’ Category
Another problem we sorted out while developing with magento is after installation of magento 1.4 with sample data, all categories are showing up but when you view the categories it doesn’t show the products under the categories.
If you are the one who stuck up with the same problem follow the instructions and your problem would be solved.
1. Goto your admin panel, select System->Index management, Select all and select “Reindex data” from actions drop down and click on submit. It would take some time to re index it, once its finished. Go to front end and see your products are listed now.
If your products are not listed follow the remaining steps,
2. Goto admin panel, System->Manage Stores, Select the store name, by default it would be “Main Store“, Click to edit it, on the edit screen, See to it that “Root Category” points to your root catalog, ie., All the categories are been formed under this root catalog.
If its not pointing then make sure it points to your real root catalog. Then click on “Save Store” .
Now if you clear your cache and look your front end, you would see your products listed on the desired categories.
Please leave your thoughts as comments.
After sharing the solutions on the magento forum, I thought I would blog it so one day or the other it might be useful to someone.
I would try to post it regularly on these kind of problems
1. Unable to login into admin after installation
If you are using Magento 1.4 then look into the following path
app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
Find the following lines:
// session cookie params
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath()/*,
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()*/
);
if (!$cookieParams['httponly']) {
unset($cookieParams['httponly']);
if (!$cookieParams['secure']) {
unset($cookieParams['secure']);
if (!$cookieParams['domain']) {
unset($cookieParams['domain']);
}
}
}
if (isset($cookieParams['domain'])) {
$cookieParams['domain'] = $cookie->getDomain();
}
Replace it with the following
// session cookie params
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath()/*,
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()*/
);
/*if (!$cookieParams['httponly']) {
unset($cookieParams['httponly']);
if (!$cookieParams['secure']) {
unset($cookieParams['secure']);
if (!$cookieParams['domain']) {
unset($cookieParams['domain']);
}
}
}
if (isset($cookieParams['domain'])) {
$cookieParams['domain'] = $cookie->getDomain();
}*/
You would be able to login into your admin panel. By doing so it would work with your local development server. What we are doing is simply commenting out the code which doesn’t allow localhost or anything that is not a domain.
2. How best to clear cache:
In magento another major problem users face is they don’t know how to clear their cache.
Follow these steps carefully:
1. Backup your cache directory if in case you need it, its located at
var/cache/*
2. Delete all folders inside the var/cache/ folder, don’t delete the cache folder instead delete all folders inside the cache folder.
If you are using mangeto versions prior to 1.4 then you should adapt one more step too.
3. Backup app/etc/use_cache.ser, I mean you can also rename the file to app/etc/use_cache1.ser
4. Delete the app/etc/use_cache.ser file
5. Reload the magento in a new browser and you would be able to clear cache.
Everyone know that magento is one of a great ecommerce application. what really concerns one from using magento is the speed. I tried to get the performance increase by 265 times faster. I used the http://www.freespeedtest.com/ to check the loading time. We checked it against one of our theme at its PECoin.
The loading time before the .htaccess is 8 secs and after the modification it was on an average 2.6 secs.
I tried to explain things but I know you wanted some code to be pasted in your .htaccess.
Ok here we go:
Find the following lines from your .htaccess on magento root folder and replace it with the following:
############################################## enable apache served files compression## http://developer.yahoo.com/performance/rules.html#gzip# Insert filterSetOutputFilter DEFLATE# Netscape 4.x has some problems…BrowserMatch ^Mozilla/4 gzip-only-text/html# Netscape 4.06-4.08 have some more problemsBrowserMatch ^Mozilla/4\.0[678] no-gzip# MSIE masquerades as Netscape, but it is fineBrowserMatch \bMSIE !no-gzip !gzip-only-text/html# Don’t compress imagesSetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary# Make sure proxies don’t deliver the wrong contentHeader append Vary User-Agent env=!dont-vary##############################################
—————————
Now on to explanation:
SetOutputFilter DEFLATE
It tells apache to compress the response before the response is been sent over network.
Credits:
More over I did tried it from reading at http://httpd.apache.org/docs/2.0/mod/mod_deflate.html and thanks to inchoo for their blog post.




