I want to add some Cash on delivery charges in my magento 1.9.3.2 website. Which can be automatically added in bill in onepage checkout page and also in invoice. I do not want to add any extension.
Kindly help me out form this.
Than in advance.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI want to add some Cash on delivery charges in my magento 1.9.3.2 website. Which can be automatically added in bill in onepage checkout page and also in invoice. I do not want to add any extension.
Kindly help me out form this.
Than in advance.
Magento default dont support this feature..... you can try this github code :
https://github.com/yvoronoy/magento-extension-extra-fee
here is sample code
class Voronoy_ExtraFee_Block_Sales_Order_Totals_Rule extends Mage_Core_Block_Abstract
{
/**
* Get Source Model
*
* @return mixed
*/
public function getSource()
{
return $this->getParentBlock()->getSource();
}
/**
* Add this total to parent
*/
public function initTotals()
{
if ((float) $this->getSource()->getExtraFeeRuleAmount() <= 0) {
return $this;
}
if ($this->getSource()->getExtraFeeRuleDescription()) {
$discountLabel = $this->__('%s (%s)', Mage::helper('voronoy_extrafee')->getExtraFeeRuleLabel(),
$this->getSource()->getExtraFeeRuleDescription());
} else {
$discountLabel = Mage::helper('voronoy_extrafee')->getExtraFeeRuleLabel();
}
$total = new Varien_Object(array(
'code' => 'extra_fee_rule',
'field' => 'extra_fee_rule_amount',
'value' => $this->getSource()->getExtraFeeRuleAmount(),
'label' => $discountLabel
));
$this->getParentBlock()->addTotalBefore($total, 'grand_total');
return $this;
}
}