carlos_tlewis Posted April 19, 2020 Share Posted April 19, 2020 Hello, I use the Data feed to get the product pricing from WHMCS for my website. What I want to do is make the currency update to their location. I want it to do it automatically based on their location, rather than them having to select the currency. On WHMCS I have made it so when they are on WHMCS it auto detects their country and shows the correct currency. I'm hoping I can do the same on my website. Thanks in Advance! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 20, 2020 Share Posted April 20, 2020 21 hours ago, carlos_tlewis said: On WHMCS I have made it so when they are on WHMCS it auto detects their country and shows the correct currency. I'm hoping I can do the same on my website. how are you detecting country in WHMCS - using MG's free hook or another method? I would have thought all you need to do is setup a similar geolocation solution for your main site and then use a variable in the feed that passes the appropriate currency value for the estimated country location. 0 Quote Link to comment Share on other sites More sharing options...
carlos_tlewis Posted April 20, 2020 Author Share Posted April 20, 2020 Hi brian! Thanks for replying. Yes using the MG free hook. I was thinking that, I seem to be struggling to find one thats not too fancy. A lot seem to come with control panels etc. just want something similar to MG. I'll keep looking 🙂 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 20, 2020 Share Posted April 20, 2020 22 minutes ago, carlos_tlewis said: I was thinking that, I seem to be struggling to find one thats not too fancy. A lot seem to come with control panels etc. just want something similar to MG. I'll keep looking 🙂 about the simplest i've seen is - https://ipgeolocationapi.com/ - as long as you don't hammer it with requests! 0 Quote Link to comment Share on other sites More sharing options...
carlos_tlewis Posted April 21, 2020 Author Share Posted April 21, 2020 On 4/20/2020 at 12:48 PM, brian! said: about the simplest i've seen is - https://ipgeolocationapi.com/ - as long as you don't hammer it with requests! Thanks Brian!. I've been having a look into this one but I don't think it's going to work right. I've asked the MG guys to see if they can do a custom script for me. See what they say. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 22, 2020 Share Posted April 22, 2020 14 hours ago, carlos_tlewis said: I've asked the MG guys to see if they can do a custom script for me. See what they say. you might need to have a word with your bank manager if their quote is large! 🤑 0 Quote Link to comment Share on other sites More sharing options...
carlos_tlewis Posted April 22, 2020 Author Share Posted April 22, 2020 9 hours ago, brian! said: you might need to have a word with your bank manager if their quote is large! 🤑 Yeah you're probably not wrong. Think I'm getting a little lazy. Been playing with script to trying to get it to work but no joy! 0 Quote Link to comment Share on other sites More sharing options...
carlos_tlewis Posted April 23, 2020 Author Share Posted April 23, 2020 All I really want is a way for the client to be able to change the currency, even if they have to click a flag to change this. Currently I have 2 web pages, one in the UK and one in the US. Which is a pain and not really a good way to do things. Example: UK or US When they click UK it will change all the currency to £ Not looking for anything fancy. Any ideas? tried going on getacoder but it seems down right now. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 24, 2020 Share Posted April 24, 2020 15 hours ago, carlos_tlewis said: All I really want is a way for the client to be able to change the currency, even if they have to click a flag to change this. Currently I have 2 web pages, one in the UK and one in the US. Which is a pain and not really a good way to do things. this bit isn't relevant to you, but i'll mention for anyone else wanting to add currency to the header in WHMCS directly... now as I said, that won't apply to you because you're wanting to do this on an external site.. and have it influence a data feed. 15 hours ago, carlos_tlewis said: Example: UK or US When they click UK it will change all the currency to £ Not looking for anything fancy. Any ideas? tried going on getacoder but it seems down right now. fundamentally, you just need to pass a variable value into the feed for the currency - but as i've got no idea if this external site is html, php, wordpress or whatever, i'll give you a basic way to do it in php... <html> <body> <?php $currency = $_GET['currency']; echo "<a href=\"".$_SERVER["PHP_SELF"]."?currency=1\">GBP</a> <a href=\"".$_SERVER["PHP_SELF"]."?currency=2\">USD</a><br><br>"; ?> <script language="javascript" src="feeds/productsinfo.php?pid=1&get=price&billingcycle=monthly¤cy=<?php echo $currency ?>"></script> </body> </html> obviously, those links can be replaced with flags, images etc and there are other ways to do this - the point being that you are passing a currency value to the data feed and it is then using that value to pull the correct detail for that currency from the database. 3 Quote Link to comment Share on other sites More sharing options...
carlos_tlewis Posted April 24, 2020 Author Share Posted April 24, 2020 Brian! this is brilliant, thank you so much for this! It works for what I want to do and I can work from it. Also the other parts it your post are very useful too. Again thank you for your time and helping! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.