• Hi could someone help me out, please

    I’m trying to add a months option to Finance Calculator plugin, I contacted the developer via support but the reply I got was * You probably need to edit the PHP code.

    but unfortunately I don’t offer support for these plugins. )

    I’m not a developer and don’t know how to edit PHP I could try editing things but I would be shooting in the dark.

    If anyone could help me out

    Thanks

    • This topic was modified 3 years, 3 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    Do you mean replace the years dropdown with a months input field? Or have the option of using either? Replacement is relatively simple. Either or gets more complicated. Replacement would involve changing the select element to something like
    <input type="number" name="txtYrs" id="txtYrs" onchange="calcAmt(this.form);">
    And changing the preceding label from years to months. You don’t have to, but changing the element name and id would be less confusing.

    The JS function calcAmt() calculates payment periods based on this number. It calculates months, fortnight, or weekly periods. Alter the divisors here accordingly. If you changed the element name and id, be sure the reference here is changed as well. There may be other details I’m missing, but that’s the gist of it.

    Because you’ve significantly altered the plugin, you should rename it so it’s protected from updates. This does mean you could miss important security updates, so it’d be a good idea to to keep a deactivated copy of the original installed and review what changes are being made during its updates.

    Thread Starter akgt

    (@akgt)

    First of all, thank you very much for replying.

    at the moment I would be satisfied if I could get the months or weeks working but it would be better if I could get multiple options working years, months, fortnight, or weekly periods.

    • This reply was modified 3 years, 3 months ago by akgt.
    Moderator bcworkz

    (@bcworkz)

    I suggest getting only months working for now to ensure you’ve found everything that needs to be changed. Make the current years dropdown into a comment so you can reuse it later, unless you’d rather it too be a number type input element. Expanding the code later to allow selection of units would mainly be just more JS coding. And adding an extra units field to the form.

    The calcAmt() function would then have a if/elseif/else or switch/case structure to use various divisors to calculate periods based on the selected units.

    Thread Starter akgt

    (@akgt)

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Help add months option to Finance Calculator plugin’ is closed to new replies.