一位客户注意到她的系统中的管理仪表板计算与订单报表不匹配,因为所谓的“收入”实际上显示的是利润,如附图所示。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