In payment, to show extra information you will use the info
block.
Step1:
Assign the info block in your custom payment model file
protected $_infoBlockType = 'payment/info_[custom_payment_name]';
Step 2:
Need to set emi options in $this->getInfoInstance()
. Please refer the Mage_Payment_Model_Method_Purchaseorder
file and function name assignData()
$this->getInfoInstance()->setAdditionalData([get emi option value]);
for ex:
$details['emi'] = 'xxxx';
$this->getInfoInstance()->setAdditionalData(serialize($details));
Step 3:
In Block folder create the payment info file extends info block, assign the payment info template file. Please refer default payment file(Purchaseorder), function name _construct()
and add the additional data conversion refer below
protected function _construct()
{
parent::_construct();
$this->setTemplate('payment/info/[custompayment].phtml');
}
protected $_emi;
public function getEmi()
{
if (is_null($this->_emi)) {
$this->_convertAdditionalData();
}
return $this->_emi;
}
protected function _convertAdditionalData()
{
$this->_emi = '';
$details = @unserialize($this->getInfo()->getAdditionalData());
if (is_array($details)) {
$this->_emi = isset($details['emi']) ? (string) $details['emi'] : '';
}
return $this;
}
Step 4:
Create phtml file design folder under current theme, app/design/fronted/[package]/[theme]/template/payment/info/[custom_payment_name].phtml
<?php
echo ( if($this->getEmi()) ? $this->getEmi() : '');
?>
Please check additional_data
field in sales_flat_order_payment
table for that last order, you can find the data details added.
Try this. Hope this help you