About Zakaat:
Short video by Maulana Iqbal
function zakat_calculator_shortcode() {
ob_start();
?>
<div id="zakat-calculator">
<form id="zakatForm">
<label for="cash">Cash Savings (in your currency):</label>
<input type="number" id="cash" name="cash" step="0.01" required>
<label for="gold">Gold Value (in your currency):</label>
<input type="number" id="gold" name="gold" step="0.01" required>
<label for="silver">Silver Value (in your currency):</label>
<input type="number" id="silver" name="silver" step="0.01" required>
<label for="investments">Investments (Stocks, Mutual Funds, etc.):</label>
<input type="number" id="investments" name="investments" step="0.01" required>
<label for="debt">Debts You Owe:</label>
<input type="number" id="debt" name="debt" step="0.01" required>
<button type="button" onclick="calculateZakat()">Calculate Zakat</button>
</form>
<div id="zakatResult"></div>
</div>
<script>
function calculateZakat() {
const cash = parseFloat(document.getElementById('cash').value) || 0;
const gold = parseFloat(document.getElementById('gold').value) || 0;
const silver = parseFloat(document.getElementById('silver').value) || 0;
const investments = parseFloat(document.getElementById('investments').value) || 0;
const debt = parseFloat(document.getElementById('debt').value) || 0;
const totalWealth = cash + gold + silver + investments - debt;
const zakat = totalWealth > 0 ? (totalWealth * 0.025).toFixed(2) : 0;
document.getElementById('zakatResult').innerHTML = `Total Zakat Due: ${zakat}`;
}
</script>
<?php
return ob_get_clean();
}
add_shortcode('zakat_calculator', 'zakat_calculator_shortcode');
Pay with our QR Code: