FZeus Posted January 8, 2021 Share Posted January 8, 2021 How are data feeds used and what do they do . I need a domain checker to redirect to whmcs https://docs.whmcs.com/Data_Feeds 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 11, 2021 Share Posted January 11, 2021 On 08/01/2021 at 20:24, FZeus said: How are data feeds used you just copy the code to your template or file, e,g adding the code below would show a domainchecker form... <script language="javascript" src="feeds/domainchecker.php"></script> same situation applies with regards to using captcha, if enabled on domainchecker, even the above feed might not work correctly. On 08/01/2021 at 20:24, FZeus said: what do they do they are used to display WHMCS content on pages outside of WHMCS (can be used in WHMCS if necessary) - so that can be a domain checker, showing a price for a particular product or TLD, a domain pricing table etc. 0 Quote Link to comment Share on other sites More sharing options...
edherroj Posted February 12, 2021 Share Posted February 12, 2021 (edited) Hi everyone, I noticed the src = file path ... should be relative to the path of your WHMCS installation folder. Also I’m trying to use this code with Bakery Builder and it’s causing the templates to break, it works but it messes up the rest of elements within the page. Is there a better way of using this dynamic code in a website built with Wordpress? Thank you! Edited February 12, 2021 by edherroj 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 12, 2021 Share Posted February 12, 2021 3 hours ago, edherroj said: Is there a better way of using this dynamic code in a website built with Wordpress? possibly WHMPress would be an option as I think that's compatible with the Bakery Builder... 3 hours ago, edherroj said: it works but it messes up the rest of elements within the page. are all the tags generated by the feed being closed ? 0 Quote Link to comment Share on other sites More sharing options...
edherroj Posted February 12, 2021 Share Posted February 12, 2021 Yes, the tags generated by the feed are closed. I switched to Classic Mode of the Builder and it's now letting me work fine. Thanks for the suggested plugin but I'm trying to work just with the WordPress theme and WHMCS. Is there a way to play with the variables for period registrations? The Domain Pricing Table only shows 1 year for all? Thank you for the help! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 13, 2021 Share Posted February 13, 2021 21 hours ago, edherroj said: Is there a way to play with the variables for period registrations? The Domain Pricing Table only shows 1 year for all? if you're talking about the domain pricing table data feed, then it should show pricing for the smallest period with a price in that currency, e.g if a TLD has a 1 year price, it will show that; if it doesn't have a 1 year price, but a 2-year price, then it will show the 2 year price and change the years value in the table to 2. are you seeing something different ? 0 Quote Link to comment Share on other sites More sharing options...
edherroj Posted February 14, 2021 Share Posted February 14, 2021 Yes, the domain pricing table data feed. It's fine then, I'm coding a custom pricing table on the main website and wanted to put a toggle switch to show pricing for 1,2,3 year registration, but I suppose the data feed has no option for that. Does it? Thanks for your replies, really helpful! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 14, 2021 Share Posted February 14, 2021 11 hours ago, edherroj said: Yes, the domain pricing table data feed. It's fine then, I'm coding a custom pricing table on the main website and wanted to put a toggle switch to show pricing for 1,2,3 year registration, but I suppose the data feed has no option for that. Does it? not out of the box - the default pricing table feed would use an in-built function to just get the lowest cycle prices for each TLD, and you can't pass parameters to it other than currency. that said, there is nothing to stop you from writing a custom data feed (don't edit the original feeds as they'll get overwritten during an update) that queries the database for the specific yearly pricing data that you require... there would be two ways to do that - either directly with a capsule query to the relevant database table, tblpricing and tbldomainpricing, choosing a currency and/or year as parameters in the query, or by using the GetTLDPricing API to do some of the initial hard work for you... in either method, you'll end up with an array that you will have to loop through to create your feed output... if you only had a handful (literally single figures) of TLDs, then you might get away with using separate domainprice.php calls for each register/trans/renew price per year... but I assume you will almost certainly have too many TLDs priced to make that a viable option. 1 Quote Link to comment Share on other sites More sharing options...
edherroj Posted February 14, 2021 Share Posted February 14, 2021 Thanks for the suggestion, I'll stick with the defaults! BTW, what is the simplest way of redirecting links in WHMCS ... any link, nothing specific. Should I use a hook for this? The thing is, there is an add-on product which description shows a link to a landing page and I don't want this link to show up in the add-on description ... but after looking for hours for the template file or the code to edit it, I gave up with no success. So what I'm planning to do is simply redirect this link to a custom page on the main site. Lots of thanks, appreciate your dedication to the community 😎 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 15, 2021 Share Posted February 15, 2021 14 hours ago, edherroj said: Thanks for the suggestion, I'll stick with the defaults! 😉 14 hours ago, edherroj said: BTW, what is the simplest way of redirecting links in WHMCS ... any link, nothing specific. Should I use a hook for this? specifics are often useful.... I mean you could redirect links generically with htaccess etc, but even when using hooks, there would be multiple ways to do it depending upon the link itself and where it's redirecting to and how. 15 hours ago, edherroj said: The thing is, there is an add-on product which description shows a link to a landing page and I don't want this link to show up in the add-on description ... but after looking for hours for the template file or the code to edit it, I gave up with no success. So what I'm planning to do is simply redirect this link to a custom page on the main site. is it a MarketConnect product addon, e.g SpamExperts, SSL etc and the "Learn More..." link ? if so, then any of them can be removed, redirected, modified etc using a hook... or even using Smarty in the template if you had/wanted to. if a MC addon, which one and what do you want to do - remove the link or change it ? 0 Quote Link to comment Share on other sites More sharing options...
edherroj Posted February 19, 2021 Share Posted February 19, 2021 On 2/15/2021 at 9:47 AM, brian! said: 😉 specifics are often useful.... I mean you could redirect links generically with htaccess etc, but even when using hooks, there would be multiple ways to do it depending upon the link itself and where it's redirecting to and how. is it a MarketConnect product addon, e.g SpamExperts, SSL etc and the "Learn More..." link ? if so, then any of them can be removed, redirected, modified etc using a hook... or even using Smarty in the template if you had/wanted to. if a MC addon, which one and what do you want to do - remove the link or change it ? Yes, its OX App Suite ... Learn More ... link. I need this to redirect to my website. Do you have a sample hook for this one by any change? Thank you, 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 20, 2021 Share Posted February 20, 2021 12 hours ago, edherroj said: Yes, its OX App Suite ... Learn More ... link. I need this to redirect to my website. Do you have a sample hook for this one by any change? the hook below should work.... <?php # Change MarketConnect Addons Links Hook v1.0 # Written by brian! function change_marketconnect_addons_links_hook($vars) { if ($vars['templatefile'] == "configureproduct") { $oldurl = '/clients/store/professional-email'; $newurl = 'https://www.google.com'; $cartaddons = $vars['addonsPromoOutput']; foreach ($cartaddons as $key => $addon) { if (strpos($addon,'container-ox') !== false) { $cartaddons[$key] = str_replace($oldurl,$newurl,$addon); } } return array("addonsPromoOutput" => $cartaddons); } } add_hook("ClientAreaPageCart", 1, "change_marketconnect_addons_links_hook"); the only two things that you should need to change are the values for $oldurl and $newurl - $oldurl will be the current value in the href (which you can see by viewing the source of the page in the browser), and $newurl will be the URL that you want the link to use. 1 Quote Link to comment Share on other sites More sharing options...
edherroj Posted February 20, 2021 Share Posted February 20, 2021 1 hour ago, brian! said: the hook below should work.... <?php # Change MarketConnect Addons Links Hook v1.0 # Written by brian! function change_marketconnect_addons_links_hook($vars) { if ($vars['templatefile'] == "configureproduct") { $oldurl = '/clients/store/professional-email'; $newurl = 'https://www.google.com'; $cartaddons = $vars['addonsPromoOutput']; foreach ($cartaddons as $key => $addon) { if (strpos($addon,'container-ox') !== false) { $cartaddons[$key] = str_replace($oldurl,$newurl,$addon); } } return array("addonsPromoOutput" => $cartaddons); } } add_hook("ClientAreaPageCart", 1, "change_marketconnect_addons_links_hook"); the only two things that you should need to change are the values for $oldurl and $newurl - $oldurl will be the current value in the href (which you can see by viewing the source of the page in the browser), and $newurl will be the URL that you want the link to use. Almost worked! but it's adding the WHMCS installation path url as a prefix of the new url. The result is something like: https://www.mysite.com/whmcs/mysite.com/new-url 😞 0 Quote Link to comment Share on other sites More sharing options...
edherroj Posted February 21, 2021 Share Posted February 21, 2021 19 hours ago, edherroj said: Almost worked! but it's adding the WHMCS installation path url as a prefix of the new url. The result is something like: https://www.mysite.com/whmcs/mysite.com/new-url 😞 Never mind, it worked perfectly, I was inserting the wrong URL. Thank you! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 21, 2021 Share Posted February 21, 2021 Hi Ed, 2 minutes ago, edherroj said: Never mind, it worked perfectly, I was inserting the wrong URL. Thank you! i'm glad that you got it working. 🙂 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.