Troubled Magento user
Troubled Magento user

Reputation: 179

Magento - Display payment fee on the order page (admin backend)

During the checkout process I can use the addTotal method on the address object to add a payment fee to be displayed for the user.

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

Is there any equivilent on the order/invoice object in the administration backend? If not, how can I display my payment fee on the order page (backend)? I've got the payment fee in the sales_flat_order table.

Upvotes: 0

Views: 2845

Answers (1)

clockworkgeek
clockworkgeek

Reputation: 37700

In the backend you must provide some sort of block.

config.xml

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

design/adminhtml/default/default/layout/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>

design/adminhtml/default/default/template/YOUR/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>

Upvotes: 4

Related Questions