A little calculator block that you could use to allow users to work out for example: how much money they might make. To include it use something like this Comcode on a page:


[block message='You could be earning as much as $xxx per year after your first year' equation='Math.pow((this.totalPerSale*this.numAverageSales)*this.numPerLevel,(1+this.levelsAchieved*(this.fractionPerLevel/100)))' totalPerSale='Commission per sale in $' numAverageSales='Number of sales per reseller per year' numPerLevel='Number of partners per reseller per year' levelsAchieved='The number of partner levels in a year' fractionPerLevel='Relative partner commission per sale in %']main_calculator[/block]

This is coded as a 'mini block', and serves as a good example of how you can use PHP on a page. We have coded it into sources_custom/miniblocks/main_calculator.php


Licensed on the same terms as Composr


Back to Top