Showing posts from 2012

Magento: can't login to admin panel, can't add product to cart

If ever you encountered issues like you cannot login to the admin panel or cannot even add product to the cart, I have a better solution for you.

Using phpMyAdmin, in your magento database, look for the core_config_data table and click it. Click the "Search" tab.  Then on the "path" column set the operator to LIKE %...% and the Value to cookie and click the "Go" button to search.

After searching, set the value of web/cookie/cookie_path, web/cookie/cookie_domain, web/cookie/cookie_httponly, and web/browser_capabilities/cookies to NULL
Just like this on the screenshot.
Adding product to cart and logging in to the admin panel should work now!

Git: Colorizing

It's much easier to work with Git especially if it's colorized. And you can do that by simply executing these in your Terminal :

git config --global core.pager "less -FRSX" git config --global color.ui auto git config --global color.pager true

Ubuntu: MySQL import/export with gunzip

To export your mysql database simply do the following :

mysqldump -u user -p database | gzip > database.sql.gzAnd to import it :

gunzip < database.sql.gz | mysql -u user -p database

Magento: Unable to list current working directory.

If you are experiencing this error :
"Unable to list current working directory." when saving the product images you uploaded, simply change the permission of the media folder by doing like this :

chmod -R 777 media

Magento: How to fix "The requested URL /index.php was not found on this server" error

If ever you're seeing an error like this when you go to your magento inner pages.

This might fix your problem. In your .htaccess file you probably have something like this :

RewriteRule ^(.*)$ /index.php/$1 [L,QSA,PT]

RewriteRule .* /index.php [NS,L]
If that is so, just simply remove the leading "/" from the index.php then save it.
Refresh the page. And voila! The issue should be fixed now.

Ubuntu: How to install Compass

Just do the following and everything will be okay.

sudo aptitude install rubygems
(if aptitude doesn't work, you need to install it first by doing this: sudo apt-get install aptitude) sudo gem install compass cd /usr/bin sudo ln -s /var/lib/gems/1.8/bin/compass compass

Magento: How to create a configurable product with associated simple products

Step 1 - Create a simple product.

Fill in all the required fields

Select configurable attributes

Set the "Visibility" to "Not Visible Individually" so that obviously this will not be visible in the frontend and if you are intending to only have configurable products in your store.

Don't forget to fill in the "Qty" and "Stock Availability" in the "Inventory" tab

and assign it to a specific category.

Then after filling all those fields, hit the "Save/Save and Continue" button

Step 2 - Create a configurable product.

Just follow the same process on Step 1.
But this time you have to do the following :
1. Set "Product Type" as "Configurable Product"
2. Select configurable attributes
3. And associate the simple product(s) you want to be associated to this configurable product.

And never forget to hit the "Save/Save and Continue" button! When you go to the frontend you will see now the configurable p…

Magento : Add Custom Layout Template

Tested in CE and EE

In app/design/frontend/base/<your_theme>/layout/page.xml (CE) or app/design/frontend/enterprise/<your_theme>/layout/page.xml (EE), you will see the custom page layout handles. Just copy any of them.

E.g. :

    <page_empty translate="label">
        <label>All Empty Layout Pages</label>
        <reference name="root">
            <action method="setTemplate"><template>page/empty.phtml</template></action>
            <!-- Mark root page block that template is applied -->
            <action method="setIsHandle"><applied>1</applied></action>
            <action method="setLayoutCode"><name>empty</name></action>

I will modify it to :

    <page_homepage translate="label">
        <label>Homepage Layout Page</label>