Development of an Installment Calculator on 1C-Bitrix
Installment is a marketing tool, not a financial product. The key difference from a loan: there are no interest charges for the buyer (they are either absent or compensated by the seller to the bank). An installment calculator is simpler mathematically, but more complex logically: it needs to reflect different installment periods, early repayment conditions, and possible processing fees.
Installment mechanics
In a classic zero-overpayment installment plan:
Monthly payment = Item price ÷ Number of months
The seller compensates the bank for the difference out of their margin or through a special agreement with a partner bank.
In a "0-0-24" installment (0% down payment, 0% rate, 24 months) — hidden conditions often include mandatory insurance or an account maintenance fee. The calculator must show the real total amount.
PHP implementation of the calculation
namespace MyProject\Services;
class InstallmentCalculator
{
/**
* @param float $amount Item/service price
* @param int $months Installment term
* @param float $downPayment Down payment (0 if none)
* @param float $bankRate Actual bank rate (compensated by seller)
* @param float $commission One-time commission (0 if none)
*/
public static function calculate(
float $amount,
int $months,
float $downPayment = 0,
float $bankRate = 0,
float $commission = 0
): array {
$loanAmount = $amount - $downPayment;
$commissionFixed = $amount * ($commission / 100);
if ($bankRate == 0) {
// Classic zero-interest installment
$monthlyPayment = $loanAmount / $months;
$totalPayment = $loanAmount + $commissionFixed;
$overpayment = $commissionFixed;
} else {
// Installment with an actual rate (paid by seller, not buyer)
$monthlyRate = $bankRate / 12 / 100;
$monthlyPayment = $loanAmount * $monthlyRate
* pow(1 + $monthlyRate, $months)
/ (pow(1 + $monthlyRate, $months) - 1);
$totalPayment = $monthlyPayment * $months + $commissionFixed;
$overpayment = $totalPayment - $loanAmount;
}
return [
'down_payment' => round($downPayment, 2),
'loan_amount' => round($loanAmount, 2),
'monthly_payment' => round($monthlyPayment, 2),
'commission' => round($commissionFixed, 2),
'total_payment' => round($totalPayment, 2),
'overpayment' => round($overpayment, 2),
'months' => $months,
'is_zero_percent' => ($overpayment == 0 || $overpayment == $commissionFixed),
];
}
}
Configuration of installment options
Stores work with multiple partner banks, each offering different conditions. Storage in an HL block InstallmentPrograms:
| Field | Description |
|---|---|
UF_BANK_NAME |
Partner bank |
UF_MONTHS |
Installment term |
UF_DOWN_PAYMENT_PCT |
Minimum down payment (%) |
UF_COMMISSION_PCT |
Processing commission (%) |
UF_MIN_AMOUNT |
Minimum purchase amount |
UF_MAX_AMOUNT |
Maximum amount |
UF_CATEGORIES |
Product categories (may not apply everywhere) |
When an amount is selected, the calculator automatically displays available installment programs.
UX: displaying options
The interface shows a comparison table of options:
function renderInstallmentTable(programs, amount) {
const rows = programs
.filter(p => amount >= p.min_amount && amount <= p.max_amount)
.map(p => {
const calc = calcInstallment(amount, p.months, p.down_pct, p.commission_pct);
return `
<tr>
<td>${p.bank_name}</td>
<td>${p.months} mo.</td>
<td>${formatMoney(calc.down_payment)} (${p.down_pct}%)</td>
<td>${formatMoney(calc.monthly_payment)}/mo.</td>
<td>${calc.overpayment > 0 ? formatMoney(calc.overpayment) : '0'}</td>
<td><button onclick="selectProgram(${p.id})">Select</button></td>
</tr>
`;
});
document.getElementById('installment-table').innerHTML = rows.join('');
}
Integration with the Bitrix cart
For online stores the installment calculator is embedded in the product page and cart. The selected installment option is saved in the order properties:
// Save the selected installment program to an order property
$order = \Bitrix\Sale\Order::load($orderId);
$propertyCollection = $order->getPropertyCollection();
$installmentProp = $propertyCollection->getItemByOrderPropertyCode('INSTALLMENT_PROGRAM');
if ($installmentProp) {
$installmentProp->setValue(json_encode([
'bank' => $bankName,
'months' => $months,
'payment' => $monthlyPayment,
]));
}
$order->save();
Installment widget on the product card
The minimum payment is displayed directly on the product page — standard e-commerce practice:
// In the product template
$minMonthlyPayment = InstallmentCalculator::getMinMonthlyPayment(
$arResult['ITEM_PRICES'][0]['PRICE'],
$availablePrograms
);
if ($minMonthlyPayment) {
echo "from {$minMonthlyPayment} /mo. on installment";
}
Timelines
| Task | Timeline |
|---|---|
| Basic installment calculator (1–2 programs, product page) | 3–5 days |
| Calculator with multiple banks, comparison table, cart integration | 1.5–2 weeks |
| Full installment system with online bank application via API | 3–6 weeks |
An installment calculator lowers the psychological barrier for large purchases. Instead of "120,000 at once" the client sees "5,000 per month" — and those are very different decisions.







