I want to add a new option to the currency settings and display

Hi,

I am trying to reuse the currency feature to use the fields to allow people to set estimated Job Length... instead of a value.

I have renamed most the features but I cant remove the currency symbol.

To resolve this I would either like to hide the currency symbol completely (and just retain the value) or I would like to add a new option to the currency list for Hours.

I tried changing this in plugins/jobs-plus/app/models/je-settings-model.php but it broke the system.

Can you please advise how I can achieve this.

Many thanks
Chris

  • Adam Czajczyk

    Hey Chris,

    I hope you're well today and thank you for your question!

    This is a serious customization of the plugin, so please be aware that all the changes you make will be immediately lost upon plugin's update!

    As for the currency symbol, you may want to try a simpler way. Our "Ultimate Branding" plugin features a "site wide text replace" feature that could be useful here. Have you already given it a try?

    https://premium.wpmudev.org/project/ultimate-branding/

    Let me know if it helped!

    Cheers,
    Adam

  • chris

    Hi Adam,

    I have tried the ultimate branding plugin but it wont alter the currency symbol (including when I have set currency to "points" or "credits")

    I didn't try making anything specific in the "In this text domain" but did have it set to "Admin/Front-end = Both"

    I would prefer to make changes in this way if possible but if not I was wondering if a custom function could be added to change the wording of either Points or Credits to "h" (for hours)

    Many thanks
    Chris

  • Adam Czajczyk

    Hey Chris,

    I think we could then take a different approach. You said you've tried to modify "/jobs-plus/app/models/je-settings-model.php" file but it broke the system.

    Instead of replacing Points or Credits with "h" you may simply add a new "currency" called "hours".

    To do this, replace the last line of the $currencies array inside this file.

    This is the line to be replaced:

    "CREDITS" => array( "Credits (for credit based stores)", "43, 72, 65, 64, 69, 74, 73" )

    and this is a replacement

    "CREDITS" => array( "Credits (for credit based stores)", "43, 72, 65, 64, 69, 74, 73" ),
    			"HOURS" => array( "hours", "68" )

    The "68" value here is a hexadecimal representation of Unicode character "h". In case you'd like to change it for another letter or symbol you may find this converter handy:

    https://r12a.github.io/apps/conversion/

    For example to use an entire word "Hours", put "Hours" in a "Characters" field on this page, hit "Convert" and find the result under the "UTF-16 code units". In this case it would give you

    "48 6F 75 72 73"

    so to replace "h" with "Hours" you just need to replace "68" value in the last line of the code above with

    "48, 6F, 75, 72, 73,"

    I've tested it on my test site and it works fine. You're able to select "Hours" as a "currency" on Jobs settings page and it shows up on a jobs description page as well

    I hope that helps!

    Cheers,
    Adam