I have requirement like this.
there are two types of customer groups (retailer,distributor). If retailer want to buy any products he need to pay.
Where as distributor contain some credit for example $100.
So he can place the order with in that limit.
My thinking for this : Step1:create custom attribute credit_limit to customer account.
step2:create custom payment method called distributor credit payment.
step3:Validate the credit limit through override following method in Mage_Payment_Model_Method_Abstract class
public function canOrder()
{
return $this->_canOrder;
}
or
public function isAvailable($quote = null)
{
$checkResult = new StdClass;
$isActive = (bool)(int)$this->getConfigData('active', $quote ? $quote->getStoreId() : null);
$checkResult->isAvailable = $isActive;
$checkResult->isDeniedInConfig = !$isActive; // for future use in observers
Mage::dispatchEvent('payment_method_is_active', array(
'result' => $checkResult,
'method_instance' => $this,
'quote' => $quote,
));
if ($checkResult->isAvailable && $quote) {
$checkResult->isAvailable = $this->isApplicableToQuote($quote, self::CHECK_RECURRING_PROFILES);
}
return $checkResult->isAvailable;
}
step4:after placing the order update credit_limit for customer by observer.
Is it right direction? step3 which method i need to override? any simple way is there? Thanks in advance.