2011-01-25 75 views
0

在结帐过程中,我可以使用地址对象上的addTotal方法来添加显示给用户的支付费用。Magento - 在订单页面显示支付费用(管理后台)

$address->addTotal(array 
(
    'code' => $this->getCode(), 
    'title' => Mage::helper('payment')->__('Invoice fee'), 
    'value' => $fee 
)); 

对于管理后端中的订单/发票对象是否有任何equivilent?如果不是,我如何在订单页面(后端)上显示我的付款费用?我在sales_flat_order表中收到了付款费用。

+0

试试这个:https://magecomp.com/magento-payment-surcharge.html – 2017-12-05 07:13:10

回答

4

在后端,你必须提供某种块。

config.xml中

<config> 
    ... 
    <adminhtml> 
     <layout> 
      <updates> 
       <YOUR_MODULE> 
        <file>YOURLAYOUT.xml</file> 
       </YOUR_MODULE> 
      </updates> 
     </layout> 
    </adminhtml> 
</config> 

设计/ adminhtml /默认/缺省/布局/ YOURLAYOUT.xml

<layout> 
    <adminhtml_sales_order_view> 
     <reference name="order_totals"> 
      <block type="adminhtml/sales_order_totals_item" name="invoice_fee" template="YOUR/MODULE/total.phtml" /> 
     </reference> 
    </adminhtml_sales_order_view> 

</layout> 

设计/ adminhtml /默认/缺省的/模板/你的/MODULE/total.phtml

<tr> 
    <td class="label"><?php echo $this->__('Invoice Fee') ?></td> 
    <td class="emph"><?php echo $this->displayPriceAttribute('invoice_fee', true) ?></td> 
</tr> 
+0

感谢您的帮助。我如何定义我的XML布局文件?我假设它不是etc/config.xml(它无论如何都没有工作) – 2011-01-27 15:55:16

相关问题