multiple terms for query args

‘tax_query’ => array(
‘relation’ => ‘AND’,
‘taxonomy’ => ‘shop_order_status’,
‘field’ => ‘slug’,
‘terms’ => array( ‘pending’, ‘completed’, ‘delivered’, ‘dispatched’ ),
‘include_children’ => true,
‘operator’ => ‘IN’
) )

Install Magento With Sample Data By SSH

mkdir magento
cd magento
tar -zxvf magento-
tar -zxvf magento-sample-data-
mv magento-sample-data-* magento/media/
mv magento-sample-data- magento/data.sql
mv magento/* magento/.htaccess .
chmod o+w var var/.htaccess app/etc
chmod -R o+w media
mysql -h localhost -u oneie_oneie -p100ppneoc oneie_demo < data.sql
chmod 755 mage
./mage mage-setup .

Setting up a custom block module

Working with Magento can be a daunting task for beginners or non-developers, but it needn’t be. Following the simple instructions below you’ll see how easy it is to set up a custom block module and then display it on the front-end of your site.

Step 1: Global Config

Create a global configuration XML file for your modules (throughout the example I’m using GPMD as my namespace, but obviously you can use whatever you like):


In its most basic form this file would contain the following code:

<?xml version="1.0"?>


Step 2: Directory structure

Next, set up the directories for the module:



Step 3: Module Config

Create a config file for the module:


Note – This file must be called config.xml

In its most basic form this file would contain the following code:

<?xml version="1.0"?>


Step 4: Block class

Create the class file for your custom block:


In its most basic form this file would contain the following code:

class GPMD_Mymodule_Block_Mycustomblock extends Mage_Core_Block_Template
    // Methods (optional)

Note – You can use this file to extend the functionality of Mage_Core_Block_Template or other Magento classes.


Step 5: Template File

Create a template file that will be used to output your custom block data on the front-end:


The contents of this file will depend on what you wish to achieve, but as basic test that things are working you could simply output some text like this:

<?php echo "Hello world!"; ?>


Step 6: Display the block

This can be done in one of two ways – In one of the layout XML files, or programmatically.

For example, in…

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
        <reference name="root">
            <reference name="content">
                <block type="mymodule/mycustomblock" name="mycustomblock" as="mycustomblock" template="mymodule/mycustomblock.phtml" before="-"/>

This code is telling the custom block to display before the main content block. You can change the position by altering this parameter. For example:

  • before=”-“ positions the block before all other blocks
  • after=”-“ positions the block after all other block
  • before=”some_block” positions this block before another block with name=”some_block”
  • after=”some_block” position this block after another block with name=”some_block”

Alternatively you can output the block in one of your theme template files, in footer.phtml for example, like this:

<?php echo $this->getLayout()->createBlock('mymodule/mycustomblock')->setTemplate('mymodule/mycustomblock.phtml')->toHtml(); ?>

One of the benefits of defining your custom block as a module in this way, is that it can be easily disabled in admin:

Magento Steps

  • System > Cache Management > Disable All
  • System > Configuration > Advanced > Developer > Log Settings > Enabled => Yes
  • System > Configuration > Web > Search Engine Optimization > Use Wbe Server Rewrites => Yes
  • System > Index Management > Reindex All
  • Open .htaccess and set: SetEnv MAGE_IS_DEVELOPER_MODE “true” at the end of the file
  • Open .htaccess and set: php_value display_errors On somewhere within <IfModule mod_php5.c>
  • Rename /errors/local.xml.sample to /errors/local.xml
  • Create one sample customer with full valid American address (for example use US/California, city Alamo with ZIP 94507), and one with full valid non American address (other country) to test payment and shipping gateways properly
  • Compensate for the possible lack of email server by doing something like explained in this article.