How to be Notified About New Orders in Magento

Posted on May 25th, 2013 | Posted by admin

surprisingly enough (at least for me), you, as a store owner, are not notified by default about new orders on your store.

For really large stores with lots of activity, that may make sense. But if you run a small or medium size business you would probably prefer to be notified, especially if you make deliveries.

As with everything in Magento, it took me quite a while to figure out how that’s done. Nothing on it in the wiki, at least as far as i could see, very little about it with Google.

So here’s how it’s done:

Get Cart Quantity Within A Session in Magento

Posted on May 23rd, 2013 | Posted by admin

Get Cart Quantity Within A Session in Magento

View code in  Magento
  function getCartQuantity () {
	  $cart = Mage::getModel('checkout/cart')->getQuote()->getData();
	  if (isset($cart['items_qty']))
	 	return (int)$cart['items_qty'];
	  	return 0;
  echo getCartQuantity ().' Item(s)';

Magento: Moving Cart from Sidebar to Header

Posted on May 21st, 2013 | Posted by admin

In this Magento tutorial we will demonstrate how to move the mini-cart that resides in the right column of a fresh Magento install into the header section. This can be a popular request as the header section of a e-commerce store is a great place to include the cart especially if you are using a one column template on important pages like the homepage.

1) Now open layout\page.xml from within your theme folder and look for the following lines of code:

1 <block type="page/html_header" name="header" as="header">

and add the following line before before the closing </block> tag:

eav_attribute Table in Magento

Posted on May 19th, 2013 | Posted by admin

It is well known that Magento implements an entity-attribute-value data model. A key table in the implementation is the ‘eav_attribute’ table, who’s exposition is the subject of this blog post.

Magento uses five ‘types’ to store attribute data: datetime, decimal, int, text, and varchar(these are strongly motivated by the corresponding mySQL datatypes). So when a new eav entity type is created in Magento there are actually six tables created; one to store the entity and one for each of these ‘types’ of attribute data. The fact that this type of entity has a certain attribute is recorded in the ‘eav_attribute’ table which has the following schema:

CREATE TABLE 'eav_attribute' (
'attribute_id' smallint(5),
'entity_type_id' smallint(5),
'attribute_code' varchar(255),
'attribute_model' varchar(255),
'backend_model' varchar(255),
'backend_type' varchar(8),

Magento – How to find if you are on homepage – getIsHomePage

Posted on May 18th, 2013 | Posted by admin

Magento – How to find if you are on homepage – getIsHomePage
I needed to exclude hot products and recently viewed products block from homepage, so I needed to find if the current page is homepage. The first block of code worked on header.phtml template but not in main page template, so I ended up using 2nd option.

If you need to check this on header.phtml template then use this code:

1 <?php
2 if($this->getIsHomePage()) {
3 echo 'You are in Homepage!';
4 } else {
5 echo 'You are NOT in Homepage!';
6 }
7 ?>

If you want to check from other pages than do this:

Page 5 of 90« First...«34567»102030...Last »