Jump to content

Auto update domain pricing based on current currency rates


growe

Recommended Posts

Premise: We buy domains in USD but sell them in CAD. As currency rates change we either loose $$$ or the customer gets charged too much. Either situation is not good. This contribution solves that problem. You can choose from a variety of currencies.

 

Installation Instructions:

1) Go to http://GJinternetSolutions.com/home/downloads/1/WHMCS_Mods and download both PriceChange.php and CurrencyConverter.php

2) Drop both files into the root directory of your WHMCS install.

3) Edit the top portion of PriceChange.php to suit your needs

4) Add a cron job to your server to run PriceChange.php on a regular basis

5) Go to http://GJinternetSolutions.com/home/contact.php and let us know what you think of the mod.

6) If you make any improvements to the mod. Post your changes on this page so everyone else can benefit.

Edited by growe
Link to comment
Share on other sites

Hi, i have just been looking at your mod but i cant seem to study it

 

could you give me a little more info see if i can understand it :lol:

 

Thanks

Martyn

 

The CurrencyConverter.php file does not need any changes at all. Just drop it in along with PriceChange.php into the root directory of your whmcs install.

 

You will need to change some settings at the top of PriceChange.php

 

$update_new_customers=1;

By leaving that set to "1" the script will change the domain prices for whenever a new domain is registered/transfered in. Disable by setting to "0"

 

$update_current_customers=1;

By leaving that set to "1" the script will change the domain prices for whenever a current customer's domain is renewed. Disable by setting to "0"

 

$display_currency="CAD";

Set that to whatever currency to have WHMCS set to charge customers in. Prices will be displayed in this currency.

 

There are several "Mark-up" variables which need to be set. They determine how you will calculate the mark-up or "profit" on each domain you sell.

 

The most confusing part is probably the last settings. Here's an example....

".ca" => array(

"1" => array("currency" => "USD", "transfer" => "13.95", "register" => "13.95", "renew" => "13.95"),

"2" => array("currency" => "USD", "transfer" => "27.90", "register" => "27.90", "renew" => "27.90"),

"3" => array("currency" => "USD", "transfer" => "41.85", "register" => "41.85", "renew" => "41.85")

),

 

The first line sets the TLD (domain type) The example shows .ca which means that I will be telling the script what it costs me to register .ca domain names.

The line that starts with "1" is where I set the cost to transfer, register and renew it for 1 year

The line that starts with "2" is where I set the cost to transfer, register and renew it for 2 years

 

The above example shows USD as the currency beside the costs. That is because I pay in USD to buy my domains. As I mentioned earlier, I set $display_currency to "CAD" because I sell the domains in CAD. The script will automatically convert the amounts. If you don't want to do any conversions, just set $display_currency to the same currency as your cost.

 

In order for this to be useful you must make a "cron" entry on your system to run the PriceChange.php script on a regular basis. Mine is set to run every hour but you may decide to only run it once per day.

 

 

I hope that helps. If you still have any questions. Just let me know.

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated