Magento Themes and Magento Extensions

Merging JavaScript in Magento

Share
Posted on June 30th, 2011 | Posted by admin

This is not very tehnical article and most of you already use this feature, however I have noticed that there are many shops that are not using Magento’s default feature to merge JavaScript files. At the time prior to Magento 1.4, JavaScript merging was included, however it was limited to 10 files. Now that’s not a case anymore.

All you need to do is:

1) Go to admin section
2) Go to System->Configuration->ADVANCED (Developer)
3) Set “Merge JavaScript Files” to Yes (“No” is default)
4) What left is to Flush Javascript/CSS Cache at Cache management admin interface.

That’s it!

Setting up Magento on Git repository

Share
Posted on June 30th, 2011 | Posted by admin

Hello everyone! Recently I wrote a short article  Git vs SVN A.K.A. Everyone likes control. Now, I wanted to give you an “real life” example of putting Magento project into Git repository.

So, let’s begin. First of all, I assume that you wish to start with fresh project and that you’ll be doing only back-end programming. This is important because I’ll set up repository only for /app/code/local/ folder. It will keep the repository lightweight and enough for this practical example. At the end, I’ll explain .gitignore file so that you can make modifications to folders you wish to include.

Preparing Git locally

There are two steps you must go through before you start working with Git:

  1. To get started, you need to install Git on your machine – you can find instructions by going on this page.
  2. Next thing you need to do is to find yourself a Git repository that you’ll use for your projects. For this example, I used free private repository located at http://gitfarm.appspot.com/.

Setting up Magento debug enviroment using xdebug and Aptana Studio

Share
Posted on June 30th, 2011 | Posted by admin

I’m using Aptana studio for few months already.
It is Eclipse/PDT based so I’m sure all this can be achieved in any Eclipse based platform.

First you should have xdebug php extension installed. Installation instructions are slightly different
for everyone and that’s why there is a tool which will help you: http://www.xdebug.org/find-binary.php
I ended up with this php.ini config following their instructions tailored just for my config:

zend_extension_ts = C:\WampDeveloper\Components\Php\ext\php_xdebug-2.1.0-5.2-vc6.dll

But that wasn’t enough so you will need to add this lines to your php.ini as well:

xdebug.remote_enable=1
xdebug.remote_host=”127.0.0.1″
xdebug.remote_port=9001

Default port is actually 9000, but I changed it to 9001 since I had some problems on 9000, but it doesn’t mean you will have it too.

Restart your web server and you are good to go (fortunately).

Now we need to configure Aptana to use it.

Ecommerce is growing. But how fast?

Share
Posted on June 30th, 2011 | Posted by admin

Everyone knows that the ecommerce industry is growing.
But do you know how fast? Or what percent of all the retail sales it takes?

United States Census Bureau published Quarterly E-Commerce Report on November 17th, 2010.
This is the latest statistics on ecommerce available for United States.

The U.S. Census Bureau, pre-eminent collector and disseminator of timely, relevant, and quality data about the people and the economy of the United States, conducts a population and housing census every 10 years, an economic census every five years, and more than 100 demographic and economic surveys every year, all of them evolving from the first census in 1790.

3rd quarter of 2010 shows rather good results with 41,5 billion USD retail sales in ecommerce. It accounts for almost 4.2% of the total retail sales in US.

Dispatching before and after events to Magento core actions

Share
Posted on June 29th, 2011 | Posted by admin

As we all probably know, there are some events in Magento that are dispatched by default.
We can easily hook on those events, but this is not a subject of this article.

What we are going to try now is to add custom event before and after some action in some of Magento’s controllers.

That way we don’t need to have event dispatched by default.
Of course, there are some actions that require little more things to handle (for example if you need something from session and session is cleared after action is run), but
for most of the situations there is a way to get what we need from that event.