我一直在尝试从发票 pdf 中删除这一行(税:)。它不知道它会这么难,花了我 5 个小时,我仍然被困住了。
它是销售发票中的打印按钮。在管理员中
请帮忙!
我最后一次尝试是
放置在if($totalInfo['source_field'] == 'tax_amount') {continue;}
foreach下面()
在 Mage_Sales_Model_Order_Pdf_Abstract 的 _getTotalsList($Source) 中(稍后我将覆盖它)
protected function _getTotalsList($source)
{
$totals = Mage::getConfig()->getNode('global/pdf/totals')->asArray();
usort($totals, array($this, '_sortTotalsList'));
$totalModels = array();
foreach ($totals as $index => $totalInfo) {
if($totalInfo['source_field'] == 'tax_amount') {continue;}
if (!empty($totalInfo['model'])) {
$totalModel = Mage::getModel($totalInfo['model']);
if ($totalModel instanceof Mage_Sales_Model_Order_Pdf_Total_Default) {
$totalInfo['model'] = $totalModel;
} else {
Mage::throwException(
Mage::helper('sales')->__('PDF total model should extend Mage_Sales_Model_Order_Pdf_Total_Default')
);
}
} else {
$totalModel = Mage::getModel($this->_defaultTotalModel);
}
$totalModel->setData($totalInfo);
$totalModels[] = $totalModel;
}
return $totalModels;
}
但它没有用。