2

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?

2

1 Answer 1

2

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);
}
1
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.