Magento themes and extensions


Posted on December 15th, 2012 | Posted by admin

The flexibility of Magento Dataflow module lies in fact you can easily create your own adapters, parsers, mappers and apply them to your specific dataflow needs.

The basic case you may wonder how to do, is import of data for your custom module. Let’s do this by example. Imagine you need to display on you e-shop list of stores, you have created custom module, table in database and datamodel part, all you need now is to populate this table with data you have within csv file.

Read the file

First you have to read the file. As you already know (if you read Magento Dataflow – Default Adapters ) you can use dataflow/convert_adapter_io adapter for this.

Magento Categorey Lists Display Order Change, Sortby Magento Categories

Posted on December 14th, 2012 | Posted by admin

How we can able to change category lists order in magento? Magento admin control panel having options to manually change the sort order in category lists.

In Magento eCommerce store Category order changed in the following way,

How to move magento var and media directories

Posted on December 13th, 2012 | Posted by admin

I wanted to move magento’s var and media directories outside of the core code base so I wouldn’t have to put them in version control. It would make updating the live web server much easier since the dynamic content of these two directories could remain in place while a new branch of the code was checked out and put along side it. First I created a directory named “common” along side the magento directory and moved the var and media directories inside this one. On my local setup, I created a new virtual host for this directory and added www.common.localhost in my hosts file.

In index.php, add a parameter to Mage::run() like so

//custom directories
$parentDir = dirname(dirname(__FILE__));
$customDirectories = array(
	'media_dir' => $parentDir . '\common\media',
	'var_dir' => $parentDir . '\common\var'

Mage::run($mageRunCode, $mageRunType, $customDirectories);

Simple way to Display Random Products in Magento

Posted on December 12th, 2012 | Posted by admin

As a Magento programmer, sometimes we need to show random products in Magento. Here in this post I have provide you with simple Magento code for displaying random products within Magento template.

Below code will get random product using order(‘rand()’) and set product collection.

  1. <?php
  2. $collection = Mage::getResourceModel(‘catalog/product_collection’);
  3. Mage::getModel(‘catalog/layer’)->prepareProductCollection($collection);
  4. $collection->getSelect()->order(‘rand()’);
  5. $collection->addStoreFilter();
  6. $this->setProductCollection($collection);
  7. return parent::_beforeToHtml();
  8. ?>

Identifying Magento Performance Problems with the Magento Profiler

Posted on December 11th, 2012 | Posted by admin

The Magento Profiler is used to identify performance problems on the server side.  The Profiler can help you find PHP functions which use up too much CPU or functions with slow database queries.

These problems will first be noticed if you have high load on your server. Apache processes can be seen using “top”, where you will see apache or httpd processes jumping to the “top” using a large percentage of CPU.

Using the Profiler requires a fairly deep (e.g. time consuming) analysis, so make sure you are barking up the right tree before proceeding with this. You’ll want to eliminate any front-end issues (such as loading large png files, too many css or javascript files, content compression, unnecessary Javascirpt, etc.) to be sure your problem is really server side (The “YSlow” firebug plugin is a good resource for client side problems).

Magento is very resource intensive, and many shared hosts will not be able to run it with decent performance.