inTempo Posted April 13, 2021 Share Posted April 13, 2021 Hi all, I use a template ontop of my WHMCS, and in that template i need to use like this {$tldPricing["com"]["register"].1} This works on my front page, but not a subpage. I tried to do a curl as help file says, but it never worked. Isnt there a easier way? Thanks. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 14, 2021 Share Posted April 14, 2021 14 hours ago, inTempo said: Isnt there a easier way? using the API in a hook? <?php # TLD Pricing on Custom Page Hook # Written by brian! function tld_pricing_on_custom_page_hook($vars) { if ($vars['filename'] == "subpage" && empty($vars['tldPricing'])) { $results = localAPI('GetTLDPricing', array('currencyid' => '1',)); return array("tldPricing" => $results['pricing']); } } add_hook('ClientAreaPage', 1, 'tld_pricing_on_custom_page_hook'); just rename "subpage" to whatever your subpage filename is (without the. .php) and select your preferred currency ID value - the returned prices won't be currency formatted (e.g no prefix/suffix), but I assume you will already know what they are and so can be added manually, or you could loop through the results array and add them in the hook (if you had to!). using Data Feeds would be an option - but if you prefer to stick with the array format used elsewhere, then the API may be your best bet. 2 Quote Link to comment Share on other sites More sharing options...
inTempo Posted April 14, 2021 Author Share Posted April 14, 2021 Thanks, did some changes so it adapts to currently selected currency, but i get a 403 when i try to post, but it works so thanks Brian 🙂 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 15, 2021 Share Posted April 15, 2021 17 hours ago, inTempo said: Thanks, did some changes so it adapts to currently selected currency, but i get a 403 when i try to post, but it works so thanks Brian 🙂 trying to use $ _ GET in the hook? for some bizarre reason, we can't post that anymore. 🙄 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.