lanquest Posted January 22, 2016 Share Posted January 22, 2016 (edited) Hi Guys, I have inserted the code below into a Joomla module on this page: https://www.lanquest-hosting.net/test-pages I cannot figure out why the pricing isn't being pulled thru. Accessing the code directly using https://www.lanquest-hosting.net/myaccount/feeds/domainpricing.php?currency=1 does not pull throu the pricing. <div id="region-top" class="row-indent"> <h2 align="center" class="ui-heading">Get a <em>Domain Name</em></h2> <div class="ui-subtitle"> <div align="center">With <span class="greytext">FREE</span>, Privacy Protection and lots more</div> </div> </div> <div> <table style="text-align: center; margin-left: auto; margin-right: auto; font-family: Arial, Helvetica, sans-serif;" class="table table-striped table-framed"> <tr> <td> <div align="center"> <script language="javascript" src="/myaccount/feeds/domainpricing.php?currency=1"></script> </div></td> </tr> </table> </div> Edited January 23, 2016 by lanquest 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 23, 2016 Share Posted January 23, 2016 i've seen this before... http://forum.whmcs.com/showthread.php?106206-6-1-0-feeds-domain-pricing it's not necessarily the data feed itself, as i've tried the feed in the above thread on my dev site as it works fine - though there are fewer TLDs in my v6 dev site than yours or lance's site. to add to the confusion, if you were to change your code to... <script language="javascript" src="/myaccount/feeds/domainpricing.php?currency=4"></script> it should show the pricing table correctly in US Dollars - but why it can do that, but not show it in GBP or EUR, I don't know. perhaps there is an error in your GBP and EUR pricing somewhere, or currency settings ? try adding the feed in the thread below to your site, and see if it can output the pricing for a specific TLD in EUR or GBP.. http://forum.whmcs.com/showthread.php?93715-Domain-Pricing-Table-Data-Feed-Specific-TLD-for-1-10-years my assumption is that it should work fine because the domainprice.php feed works ok on your site for .com 0 Quote Link to comment Share on other sites More sharing options...
lanquest Posted January 23, 2016 Author Share Posted January 23, 2016 (edited) Thanks Brian. You gave me some clues there with your response but I think I've hit a brick wall . I hope this helps someone else. As you suggested/hinted. I started looking at relevant WHMCS config areas in relation to pricing. Then I came across the General Settings > Localisation page and noticed that the System Charset field was set to ISO-8859-1 (I'm sure there is a valid reason for this). After setting this to the default value of UTF-8. I can now see USD and GBP costs but not EU costs : https://www.lanquest-hosting.net/test-pages or https://www.lanquest-hosting.net/myaccount/feeds/domainpricing.php?currency=1 I cannot get the Pound (£)=id1 or EU= (€)id 5 currency signs to stay entered into their fields under Payments > Currencies. Even if I use the shortcut keys. € Euro alt + 0128 £ Pound alt + 0163 So I had to change/insert the currency prefixes from the database table directly (tblcurrencies). But this then stops displaying the prices for these currencies and show up in WHMCS as � characters. If I remember correctly, this is why I had the General Settings > Localisation System Charset field set to ISO-8859-1. UPDATE: With all that said about the currency symbols and the charset. This is where I'm totally stuck. I've concluded that the prices will display with both charsets but not when the currency signs are entered. Why is this? The third thing is. Because of the large number of TLD's in the system. Is there a way I can have this list shown either 10 at a time or at least show the first 20 and click to expand the list? I'm guessing the feeds/domainpricing.php file needs to be edited to accommodate this? Edited January 23, 2016 by lanquest Further testing with both charsets. 0 Quote Link to comment Share on other sites More sharing options...
lanquest Posted January 23, 2016 Author Share Posted January 23, 2016 <p> I'm certainly no coder but I think I've resolved the issue with sections 1 and 2 of my previous post. I've left the System Charset field set to ISO-8859-1. Added the currency symbols to the tblcurrencies table. Created a copy of the /myaccount/feeds/domainpricing.php file. Changed all referecnces from UTF-8 to ISO-8859-1. This is now showing the all the currencies and pricing: https://www.lanquest-hosting.net/myaccount/feeds/domainpricing1.php?currency=1 and https://www.lanquest-hosting.net/test-pages [/font] [font=arial]$freeamt = formatCurrency(0);[/font] [font=arial]$tldslist = getTLDList();[/font] [font=arial]foreach ($tldslist AS $tld) {[/font] [font=arial] $tldpricing = getTLDPriceList($tld, true);[/font] [font=arial] $firstoption = current($tldpricing);[/font] [font=arial] $year = key($tldpricing);[/font] [font=arial] $transfer = ($firstoption["transfer"] == $freeamt) ? $_LANG['orderfree'] : $firstoption["transfer"];[/font] [font=arial] $code .= sprintf([/font] [font=arial] '%s%d%s%s%s',[/font] [font=arial] htmlspecialchars($tld, ENT_QUOTES, '[b]iso-8859-1'),[/font] [font=arial] $year,[/font] [font=arial] htmlspecialchars($firstoption["register"], ENT_QUOTES, 'iso-8859-1'),[/font] [font=arial] htmlspecialchars($transfer, ENT_QUOTES, 'iso-8859-1'),[/font] [font=arial] htmlspecialchars($firstoption["renew"], ENT_QUOTES, 'iso-8859-1')[/font] [font=arial] );[/font] [font=arial]}[/font] [font=arial] Now, how do I do the 3rd thing? And I'm really stuck on that part </p> - - - Updated - - - I'm certainly no coder, but I think I've resolved the issue with sections 1 and 2 of my previous post. I've left the System Charset field set to ISO-8859-1. Added the currency symbols to the tblcurrencies table. Created a copy of the /myaccount/feeds/domainpricing.php file. Changed all referecnces from UTF-8 to ISO-8859-1. This is now showing the all the currencies and pricing: https://www.lanquest-hosting.net/mya...php?currency=1 and https://www.lanquest-hosting.net/test-pages This is now showing the all the currencies and pricing: https://www.lanquest-hosting.net/myaccount/feeds/domainpricing1.php?currency=1 and https://www.lanquest-hosting.net/test-pages [/font] [font=arial]$freeamt = formatCurrency(0);[/font] [font=arial]$tldslist = getTLDList();[/font] [font=arial]foreach ($tldslist AS $tld) {[/font] [font=arial] $tldpricing = getTLDPriceList($tld, true);[/font] [font=arial] $firstoption = current($tldpricing);[/font] [font=arial] $year = key($tldpricing);[/font] [font=arial] $transfer = ($firstoption["transfer"] == $freeamt) ? $_LANG['orderfree'] : $firstoption["transfer"];[/font] [font=arial] $code .= sprintf([/font] [font=arial] '<tr><td>%s</td><td>%d</td><td>%s</td><td>%s</td><td>%s</td></tr>',[/font] [font=arial] htmlspecialchars($tld, ENT_QUOTES, 'iso-8859-1'),[/font] [font=arial] $year,[/font] [font=arial] htmlspecialchars($firstoption["register"], ENT_QUOTES, 'iso-8859-1'),[/font] [font=arial] htmlspecialchars($transfer, ENT_QUOTES, 'iso-8859-1'),[/font] [font=arial] htmlspecialchars($firstoption["renew"], ENT_QUOTES, 'iso-8859-1')[/font] [font=arial] );[/font] [font=arial]}[/font] [font=arial] Now, how do I do the 3rd thing? And I'm really stuck on that part - - - Updated - - - I'm certainly no coder, but I think I've resolved the issue with sections 1 and 2 of my previous post. I've left the System Charset field set to ISO-8859-1. Added the currency symbols to the tblcurrencies table. Created a copy of the /myaccount/feeds/domainpricing.php file. Changed all referecnces from UTF-8 to ISO-8859-1. This is now showing the all the currencies and pricing: https://www.lanquest-hosting.net/mya...php?currency=1 and https://www.lanquest-hosting.net/test-pages $freeamt = formatCurrency(0); $tldslist = getTLDList(); foreach ($tldslist AS $tld) { $tldpricing = getTLDPriceList($tld, true); $firstoption = current($tldpricing); $year = key($tldpricing); $transfer = ($firstoption["transfer"] == $freeamt) ? $_LANG['orderfree'] : $firstoption["transfer"]; $code .= sprintf( '<tr><td>%s</td><td>%d</td><td>%s</td><td>%s</td><td>%s</td></tr>', htmlspecialchars($tld, ENT_QUOTES, 'iso-8859-1'), $year, htmlspecialchars($firstoption["register"], ENT_QUOTES, 'iso-8859-1'), htmlspecialchars($transfer, ENT_QUOTES, 'iso-8859-1'), htmlspecialchars($firstoption["renew"], ENT_QUOTES, 'iso-8859-1') ); } Now, how do I do the 3rd thing? And I'm really stuck on that part 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 23, 2016 Share Posted January 23, 2016 I'm certainly no coder but I think I've resolved the issue with sections 1 and 2 of my previous post. I've left the System Charset field set to ISO-8859-1. Added the currency symbols to the tblcurrencies table. Created a copy of the /myaccount/feeds/domainpricing.php file. Changed all references from UTF-8 to ISO-8859-1. great minds think alike - I was going to suggest changing the references of UTF-8 in the feed code as a quicker solution than messing with the db charsets. the problem with the third thing is that these feeds are ancient and were designed for when there were only a few TLDs - not the hundreds there are today. however, limiting the number of rows shown is simple enough... $tldslist = getTLDList(); $rows = $_GET["rows"]; $i=0; foreach ($tldslist AS $tld) { if ($i < $rows) { $tldpricing = getTLDPriceList($tld, true); $firstoption = current($tldpricing); $year = key($tldpricing); $transfer = ($firstoption["transfer"] == $freeamt) ? $_LANG['orderfree'] : $firstoption["transfer"]; $code .= sprintf( '<tr><td>%s</td><td>%d</td><td>%s</td><td>%s</td><td>%s</td></tr>', htmlspecialchars($tld, ENT_QUOTES, 'UTF-8'), $year, htmlspecialchars($firstoption["register"], ENT_QUOTES, 'UTF-8'), htmlspecialchars($transfer, ENT_QUOTES, 'UTF-8'), htmlspecialchars($firstoption["renew"], ENT_QUOTES, 'UTF-8') ); $i +=1; }; } $code .= '</table>'; echo "document.write('".$code."');"; so, if you wanted to only show the first 20 rows, you could do... /feeds/domainpricing.php?rows=20 perhaps as a quick solution, you can include this in your page and then add a link to the full domainpricing.php feed below it. there are better/complex ways to do it, but i'm having a non-programming day today! 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.