Magento – Dashboard Last 5 Orders are missing Guest Name

The Magento Dashboard is the landing page of Magento administration. From Dashboard you can check site’s activity and performance without the need to open every section. Beside sales related data like lifetime sale, 24hour order activity, there are other interesting things like frequently used search terms within the site and recently viewed products.

One of the interesting sections is ‘Last 5 Orders’ block.
It is a list of a five most recently placed orders in your store. Customer information, items ordered, and the order totals are included. However there is one small issue with this block. All customers that have made order as Guests will not have their names displayed in this block. When you click on blank field it will lead you to Order details page and than you can see customer`s name from Billing/Shipping addresses. It is very annoying if you have a lot of customers that shop as guests and force you to open order page just to see a name of customer.

This issue can be fixed easily with small modification. Since it is really small change we will not create our own module and instead we will overwrite Magento core files. To apply changes propelly we will not edit core files directly, we will copy core files into ‘local’ folder following same path strucutre.

Files that we need to copy are (create all missing folders):
app/code/core/Mage/Reports/Model/Resource/Order/Collection.php
to a folder:
app/code/local/Mage/Reports/Model/Resource/Order/Collection.php

and:
app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php
to a folder:
app/code/local/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php

Open file ‘Collection.php’ and find function ‘joinCustomerName’ and bellow it add new function:
public function joinCustomerBillingName($alias = 'name')
{
$fields = array('t2.firstname', 't2.lastname');
$fieldConcat = $this->getConnection()->getConcatSql($fields, ' ');
$this->getSelect()
->join(array('t2' => 'sales_flat_order_address'),'main_table.billing_address_id = t2.entity_id',array($alias => $fieldConcat));
return $this;
}

Idea is to use Billing information first and last name instead Customer data, that way we will have names displayed for guests too.
After adding function we will call it in file ‘Grid.php’ file, find line:
->joinCustomerName(‘customer’)
and replace it with:
->joinCustomerBillingName(‘customer’)

While we still have ‘Grid.php’ file opened in editor we will add one more column that will show status of an order so you can really see if it is necessary to open order details page. Find function ‘_prepareColumns’ and copy this code wherever you want ‘Order status’ to appear in ‘Last 5 Orders’ block.

$this->addColumn('status', array(
'header' => Mage::helper('sales')->__('Status'),
'index' => 'status',
'type' => 'options',
'width' => '70px',
'sortable' => false,
'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
));

If for some reason instructions that I provided are not clear enough here is the patch file, all that you need to do is to download and unpack file from this link. After that copy files into your Magento installation root folder, pay attention that there are no files that will be overwritten. Once upload is done login into admin and check Dashboard, guests names should appear same as it was case for regular customers.

Be sure to make backup of your store before applying patch, in case that issue appears you will be able to easily revert changes.

Selecting product thumbnail for shopping cart

When you use configurable products in your Magento store there is an option to choose what image will be displayed when product is added to the cart. By default, Magento will use the configurable product`s thumbnail image.

To show the simple product`s thumbnail image rather than the configurable product`s thumbnail image in your Magento shop cart please go to System >> Configuration, then in the left menu click the Checkout tab. When the page loads, open the Shopping Cart box, and in that box you’ll see the “Configurable Product Image” option. Select “Product Thumbnail Itself” option.

Be sure that you have uploaded the images for all simple products and to select an image which will be used as a thumbnail. Otherwise, it might happen that Magento will use a placeholder image or configurable product`s image as a fall back.

Change position of product options on product details page

Default Magento theme allows you to set the position of product options from administration. To do that, choose a product that you want to edit and from the left side menu open ‘Design’ tab. Second option from the bottom should be ‘Display Product Options’ in a drop-down selection, with options ‘Product Info Column’ and ‘Block after Info Column’. First option will set the product options to be displayed next to the products main image (case with most standard/popular themes), while second option will put the product options on the bottom of the page as a separate block.

First layout is excellent when products have a smaller number of product options and are related to products image, for example Color Swatch, which updates the products image when attribute option is selected.

Second layout is more convenient when products have a larger number of options and require a bit more space. In this case, it is good to have the price on the top and the bottom of the page (price clone) so customers can see the price update when they select the attribute option, otherwise they will need to scroll to the top of page.

product-info-inside product-info-after