i would like to apply a 3% Fee if customer selects Paypal as payment method and if customer is a reseller. If the customer is a normal customer(and not a reseller) the fee should not be applied. Have you got suggestions on how to do so? Could i start from an existing plugin?
1 Answer
Step1: Here add module which is set extra free using http://www.classyllama.com/blog/unravelling-magentos-collecttotals-example
Step2:an do some change
public function collect(Mage_Sales_Model_Quote_Address $address)
{
parent::collect($address);
foreach ($this->_getAddressItems($address) as $item) {
$this->_applyItemSurcharge($item,$address->getQuote());
}
return $this;
}
protected function _applyItemSurcharge($item,$Quote)
{
$baseSurcharge = 0;
if($Quote->getPayment()->getMethod()=='paypal_strandard' &&($Quote->getCustomerGroupId()=='reatialergroupcode')){
$baseSurcharge =$address->getBaseGrandTotal()*3;
}
$surcharge = Mage::app()->getStore()->convertPrice($baseSurcharge);
$item->setBaseCustomSurchargeAmount($baseSurcharge);
$item->setCustomSurchargeAmount($surcharge);
$this->_addBaseAmount($baseSurcharge);
$this->_addAmount($surcharge);
}
-
Can i download a packed module somewhere? Would be easier to edit it. I'm new in Magento programming :) Commented Aug 28, 2014 at 12:44