Skip to content

Mortgage Calculator

The FOB Mortgage Calculator plugin provides a flexible and customizable mortgage calculator for your real estate website. It supports both shortcode and widget implementations.

Activation

INFO

Go to Admin -> Plugins and activate the FOB Mortgage Calculator plugin.

Activate Mortgage Calculator Plugin

Once activated, you can use the mortgage calculator via shortcode or widget.

Using Shortcode

The shortcode allows you to embed the mortgage calculator on any page or post.

Basic Usage

Add the shortcode to your page content:

[mortgage-calculator][/mortgage-calculator]

Full Example with Options

[mortgage-calculator
    style="default"
    layout="horizontal"
    form_style="modern"
    form_size="xl"
    form_alignment="center"
    form_margin="50px 0"
    form_title="Mortgage Calculator"
    form_description="Calculate your monthly mortgage payments"
    primary_color="#1d5f6f"
][/mortgage-calculator]

Adding to a Page

INFO

Go to Admin -> Pages -> Edit your page

  1. Open the page editor and click the UI Block button to open the shortcode modal

Open UI Block Modal

  1. Select Mortgage Calculator from the list

Select Mortgage Calculator

  1. Configure the shortcode parameters as needed and click Insert

Insert Mortgage Calculator

  1. Save the page

Result on frontend:

Shortcode Mortgage Calculator Result

Using Widget

The mortgage calculator is also available as a sidebar widget.

INFO

Go to Admin -> Appearance -> Widgets

  1. Find Mortgage Calculator in the available widgets list and drag it to your desired sidebar

Widget Mortgage Calculator Step 1

  1. Configure the widget settings

Widget Mortgage Calculator Step 2

  1. Save the widget

Result on frontend:

Mortgage Calculator Widget Result

Shortcode Parameters

ParameterTypeDefaultDescription
stylestringdefaultStyle variant: default or compact
layoutstringhorizontalLayout: horizontal or vertical
form_stylestringdefaultForm style: default, modern, minimal, bold, glass
form_sizestringlgForm width: full, xxl, xl, lg, md, sm
form_alignmentstringcenterAlignment: start, center, end
form_marginstring-CSS margin values (e.g., 50px 0)
form_paddingstring-CSS padding values (e.g., 30px 20px)
form_titlestring-Header title text
form_descriptionstring-Header description text
default_pricenumber-Pre-filled property price
default_termnumber20Default loan term in years
default_ratenumber10Default interest rate (%)
default_down_payment_typestringpercentDown payment type: percent or amount
default_down_payment_valuenumber20Down payment value (% or fixed amount)
show_extra_costsbooleanfalseEnable extra cost fields (taxes, insurance, HOA)
currencystring$Currency symbol
price_fromstringnonePrice source: none or property
primary_colorstring#e31837Primary UI color (hex)
background_colorstring-Background color (hex)
enable_lazy_loadingstringnoEnable lazy loading: yes or no

Form Styles

The calculator supports 5 different form styles:

  • default - Standard appearance
  • modern - Clean, contemporary design
  • minimal - Simplified, less visual elements
  • bold - Strong, prominent styling
  • glass - Glassmorphism effect with transparency

Form Sizes

Control the width of the calculator:

  • full - 100% width
  • xxl - Extra extra large
  • xl - Extra large
  • lg - Large (default)
  • md - Medium
  • sm - Small

Supported Currencies

The calculator supports multiple currency symbols:

CodeSymbol
USD$
EUR
GBP£
VND
JPY¥
CNY¥
KRW
INR
THB฿
AUDA$
CADC$
SGDS$
MYRRM
IDRRp
PHP

Calculation Methods

The calculator provides two calculation methods:

  1. Decreasing Balance - Monthly payments decrease over time as the principal is paid down
  2. Fixed Payment - Equal monthly payments throughout the loan term

Users can switch between these methods using the tabs in the calculator interface.

Features

  • Amortization Schedule - View detailed payment breakdown by month
  • Chart Visualization - Visual representation of principal vs interest
  • Responsive Design - Works on all screen sizes
  • RTL Support - Right-to-left language support
  • Lazy Loading - Optional lazy loading for better page performance

Example Configurations

Homepage Calculator

[mortgage-calculator
    style="default"
    layout="horizontal"
    form_style="modern"
    form_size="xl"
    form_alignment="center"
    form_margin="50px 0"
    form_title="Mortgage Calculator"
    form_description="Calculate your monthly mortgage payments"
    primary_color="#1d5f6f"
    background_color="#f7f7f7"
    enable_lazy_loading="yes"
][/mortgage-calculator]

Compact Sidebar Calculator

[mortgage-calculator
    style="compact"
    layout="vertical"
    form_style="minimal"
    form_size="full"
][/mortgage-calculator]

Property Page Calculator

[mortgage-calculator
    price_from="property"
    form_style="glass"
    show_extra_costs="true"
][/mortgage-calculator]

Using with Page Seeder

If you're setting up a new site and want to include the mortgage calculator programmatically, add it to your PageSeeder.php:

php
use Illuminate\Support\Facades\Html;

$pages = [
    [
        'name' => 'Home',
        'content' =>
            Html::tag('div', '[search-box ...][/search-box]') .
            Html::tag('div', '[mortgage-calculator style="default" layout="horizontal" form_style="modern" form_size="xl" form_alignment="center" form_margin="50px 0" form_title="Mortgage Calculator" form_description="Calculate your monthly mortgage payments" primary_color="#1d5f6f" background_color="#f7f7f7" enable_lazy_loading="yes"][/mortgage-calculator]'),
        'template' => 'homepage',
    ],
];

Troubleshooting

Calculator not displaying

  1. Ensure the plugin is activated in Admin -> Plugins
  2. Clear the cache: php artisan optimize:clear
  3. Check that the shortcode syntax is correct

Styles not loading

  1. Publish plugin assets: php artisan vendor:publish --tag=public
  2. Clear browser cache
  3. Run npm run prod if using custom builds

Widget not appearing

  1. Verify the widget is added to an active sidebar
  2. Check that the sidebar is rendered in your theme template