Show guest name in last 5 orders magento admin dashboard
On the magento community admin dashboard, Under "Last 5 orders" if there is an order by guest it doesnot show the name of guest customer. There were many instances when my clients wanted to show the names of guest too.
For this i have some suggestions. We can show the name from billing address there instead of the customer name. If you think my suggestion is feasible, i request to add this modification to the coming release of magento.
I have coded for this
In Mage/Adminhtml/Block/Dashboard/Orders/Grid.php about line '51' replace "->joinCustomerName('customer')" with ->joinCustomerBName('customer')
and in Mage/Reports/Model/Resource/Order/Collection.php
add a function
public function joinCustomerBName($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')->columns(array($alias => $fieldConcat));
return $this;
}
Excellent tip, was already working on Magento tweaks!
ReplyDeleteThanks man! Saved me tons of work!
ReplyDeleteThanks for your valuable appreciations
DeleteBut by doing this though Guest Name comes but on clicking it , shows error [this order does not exist] and redirects to Sales - > Order page
ReplyDeleteThank you!! Brilliant fix!
ReplyDeleteThanks Cristina.
DeleteTo anyone looking at this please do ***NOT*** do this. It will break upgrade chain of magento. As soon as you update, your 'CORE' change will be overwritten and thus this functionality will be lost. Use a rewrite of the orders grid block and then implement the above code. Coolio
ReplyDeleteGreat Read! I am impressed on how you make your article easy to understand. I'll come back for more :D
ReplyDeleteJaps Buidon is a Social Media Specialist and belongs to a team of Magento Developer in Florida. He loves hiking as well as electronics.
The blog was absolutely fantastic! Lot of great information which can be helpful in some or the other way. Keep updating the blog, looking forward for more contents...Great job, keep it up..
ReplyDeletemagento development company in bangalore
This is a great post. I like this topic.This site has lots of advantage. It helps me in many ways.Thanks for posting this again.
ReplyDeletemagento development company in bangalore
hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here.
ReplyDeleteKindly keep blogging. If anyone wants to become a Front end developer learn from javascript and jquery training in chennai .
or learn thru Javascript Training in Chennai.
Nowadays JavaScript has tons of job opportunities on various vertical industry. javascript and jquery training in chennai