-
Notifications
You must be signed in to change notification settings - Fork 2
/
Totals.php
31 lines (22 loc) · 1017 Bytes
/
Totals.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
class Ei_Creditpoint_RW_Adminhtml_Block_Sales_Order_Totals extends Mage_Adminhtml_Block_Sales_Order_Totals
{
protected function _initTotals()
{
parent::_initTotals();
//Retrieve Creditpoint Amount from sales_flat_order table order wise
$creditPointAmount = $this->getSource()->getCreditpointAmount();
$creditPoints = number_format(Mage::getModel('creditpoint/creditpoint')->load($this->getSource()->getEntityId(), 'order_id')->getAppliedCreditPoint());
if($creditPointAmount > 0){
$this->addTotalBefore(new Varien_Object(array(
'code' => Mage::helper('creditpoint')->getCode(),
'value' => '-'.$creditPointAmount,
'base_value' => '-'.$creditPointAmount,
'strong' => false,
'label' => Mage::helper('creditpoint')->getCreditPointLabel($creditPoints),
), array('shipping', 'tax')));
}
return $this;
}
}
?>