Magento Themes and Magento Extensions

How to change mysql credentials in Magento

Share
Posted on October 11th, 2012 | Posted by admin

This probably seems like a no-brainer for many people, but it came up today and I didn’t have an immediate answer.  So, if you want to change any of your MySQL database access settings (like your database name, database username, database password or database host), you’ll need to do it within the following file:
/app/etc/local.xml
Once you open that file, you’ll see it’s very basic and if you’re playing with Magento is code, you should have no problem making the necessary changes there. But for reference, here’s the code block that needs to be altered:

Migrate Your Magento Website Quickly

Share
Posted on October 10th, 2012 | Posted by admin

At the end of developing period of Magento site, the website may migrate to client’s server or live onsite. In this cases, if you follow the path like uploading (or sometimes downloading ) file by file, exporting and imporing database throught phpmyadmin, you will find it seems to a long-period exhausting tasks, but actually it should take too many time in development.

As an example, we are going to migrate “www.example-src.com” to “www.example-dst.com” in short, also you could just download shell script here.

After development and testing period of a Magento website, you’ll need to migrate it to a live server. Sometimes, you’ll need to migrate a Magento website from one server to another. However, there’re thousands of files in Magento and if you upload the whole Magento website through FTP, it will usually take a long time. Meanwhile, exporting and importing database through phpMyadmin sometimes doesn’t work well due to internet connection issue, especially when the database is huge. In this article, we introduce you how to migrate your Magento website quickly.

Displaying New Products in Magento

Share
Posted on October 9th, 2012 | Posted by admin

This method allow you to add new products to a Magento CMS page or Block.
Go to “CMS >> Manage Pages” and select “Your Page” from the list of pages.
Go to “CMS >> Static Blocks” and select “Your Block” from the list of blocks.

Use this code snippet to show new products on your front page:

{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template=
"catalog/product/new.phtml"}}

To change the number of columns in the “New Products” view:
column_count=”6″

Generated Magento Model Code

Share
Posted on October 8th, 2012 | Posted by admin

This is a quick one for advanced users, and was inspired by a recent question I answered over at StackOverflow.

One of the nice things about a well abstracted system like Magento is the opportunities it presents for meta-programming. Drop the following code in a controller action (yes, you can define an inner function in PHP)

function someAction()
{
        header('Content-Type: text/plain');
        $coupon = Mage::getModel('salesrule/rule')->load(1);        

        function outputValue($value)
        {
            switch(gettype($value))
            {
                case 'string':
                    echo "'".str_replace("'","\\'",$value)."'";
                    break;
                case 'array':
                    echo "array(";
                    foreach($value as $v)
                    {
                        outputValue($v);
                        echo ",";

Advanced search in Magento and how to use it in your own way

Share
Posted on October 7th, 2012 | Posted by admin

It’s been a while since my last post. I’ve been working on Magento quite actively last two months. I noticed this negative trend in my blogging; more I know about Magento, the less I write about it. Some things just look so easy now, and they start to feel like something I should not write about. Anyhow…. time to share some wisdom with community
Our current client uses somewhat specific (don’t they all) store set. When I say specific, i don’t imply anything bad about it. One of the stand up features at this clients site is the advanced search functionality. One of the coolest features of the built in advanced search is the possibility to search based on attributes assigned to a product.

To do the search by attributes, your attributes must have that option turned on when created (or later, when editing an attribute). In our case we had a client that wanted something like

Page 5 of 7« First...«34567»