Magento Forum

How can I change Purchased From - Data Field Output In Sales Order View? 
 
ncotrona
Sr. Member
 
Total Posts:  161
Joined:  2009-05-15
 

When viewing an order in the Sales Order View ( Admin -> Sales -> Orders -> Order View) Data is displayed, which reports which site the product was purchase from.  This field displays Website Name, Store Name, Store View Name ( See Attached Screenshot).  Rather than display Website Name, Store Name and Store View Name, I would like to display only the website name. 

Please advise how I can display only the website name? 

The code that controls this fields is below and is located at /public_html/app/design/adminhtml/default/default/template/sales/order/view/info.php

<tr>
<td class="label"><label><?php echo Mage::helper('sales')->__('Purchased From') ?></label></td>
<td class="value"><strong><?php echo $this->getOrderStoreName() ?></strong></td>
</tr>

Any assistance is much appreciated…

Image Attachments
Magento-Info.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
Siggi_Schmitz
Enthusiast
 
Avatar
Total Posts:  811
Joined:  2011-07-03
 

File: app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php
Function in File: getOrderStoreName

Change

public function getOrderStoreName()
    
{
        
if ($this->getOrder()) {
            $storeId 
$this->getOrder()->getStoreId();
            if (
is_null($storeId)) {
                $deleted 
Mage::helper('adminhtml')->__(' [deleted]');
                return 
nl2br($this->getOrder()->getStoreName()) . $deleted;
            
}
            $store 
Mage::app()->getStore($storeId);
            
$name = array(
                
$store->getWebsite()->getName(),
                
$store->getGroup()->getName(),
                
$store->getName()
            );
            return 
implode('<br/>'$name);
        
}
        
return null;
    
}

to

public function getOrderStoreName()
    
{
        
if ($this->getOrder()) {
            $storeId 
$this->getOrder()->getStoreId();
            if (
is_null($storeId)) {
                $deleted 
Mage::helper('adminhtml')->__(' [deleted]');
                return 
nl2br($this->getOrder()->getStoreName()) . $deleted;
            
}
            $store 
Mage::app()->getStore($storeId);
            
/*$name = array(
                $store->getWebsite()->getName(),
                $store->getGroup()->getName(),
                $store->getName()
            );
            return implode('<br/>', $name);*/
            
return $store->getWebsite()->getName(); // return only the website name
        
}
        
return null;
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
ncotrona
Sr. Member
 
Total Posts:  161
Joined:  2009-05-15
 

Ahhhhhh Yes!!!!

That did it...totally makes sense..

Thanks for your assistance......

 
Magento Community Magento Community
Magento Community
Magento Community
 
nicolas95
Member
 
Total Posts:  54
Joined:  2008-06-09
 

Hello,

I have 7 shops.
I want to change the name of the shop by its logo.
I would to see the back-office as shown the screenshot

How can I change the code?

Thank you for the help

Nicolas

Image Attachments
Capture.PNG
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top