一位客戶注意到她的系統中的管理儀表板計算與訂單報表不匹配,因爲所謂的「收入」實際上顯示的是利潤,如附圖所示。Magento管理儀表板修改
order report http://dl.dropbox.com/u/48637/CloudShot/shot_1212012_80701_pm.jpeg
我想要做的就是修改儀表盤頁面中加入這將是實際收入,而不是利潤5個元素。
我已經得到了添加元素到頁面。
admin dashboard http://dl.dropbox.com/u/48637/CloudShot/shot_1212012_80214_pm.jpeg
要做到這一點,我複製Totals.php從/應用程序/代碼/核心/法師/ Adminhtml /座/儀表板/到/應用/代碼/本地/法師/ Adminhtml /座/儀表板/。這是我修改的代碼:
$totals = $collection->getFirstItem();
$this->addTotal($this->__('Revenue'), $totals->getProfit());
$this->addTotal($this->__('Profit'), $totals->getRevenue());
$this->addTotal($this->__('Tax'), $totals->getTax());
$this->addTotal($this->__('Shipping'), $totals->getShipping());
$this->addTotal($this->__('Quantity'), $totals->getQuantity()*1, true);
我似乎無法找到需要調用的實際變量。有沒有人有任何想法我可以找到它或它可能是什麼?我試過Sales,SalesTotal,Invoiced,它們都返回零。
這是在第一張圖像中顯示爲銷售總額的值。
謝謝。
編輯
,我正在尋找在這個文件中沒有加載的變量。我在/ app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales /中找到了Grid.php,這是第一張圖片中的表格。
我試着插入
Mage::log($totals->debug());
在各個地方
但它會導致錯誤的每個實例。
下面是從Grid.php,這些值會爲我工作一小段代碼..
$this->addColumn('total_income_amount', array(
'header' => Mage::helper('sales')->__('Sales Total'),
'type' => 'currency',
'currency_code' => $currencyCode,
'index' => 'total_income_amount',
'total' => 'sum',
'sortable' => false
));
$this->addColumn('total_revenue_amount', array(
'header' => Mage::helper('sales')->__('Revenue'),
'type' => 'currency',
'currency_code' => $currencyCode,
'index' => 'total_revenue_amount',
'total' => 'sum',
'sortable' => false,
'visibility_filter' => array('show_actual_columns')
));
星期一早上顛簸......有人嗎? :) – nero
評論不要碰到更高的問題。此外,我添加了一個「magento」標籤,因爲更多的人可能會看到這個標籤。 – clockworkgeek
謝謝發條 – nero