Jump to content
FZeus

How do I use data feeds for domain checking

Recommended Posts

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>

n06nwLm.png

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.

Share this post


Link to post
Share on other sites

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 by edherroj

Share this post


Link to post
Share on other sites
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...

687474703a2f2f63646e2e77686d70726573732e

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 ?

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites
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 ?

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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 😎

Share this post


Link to post
Share on other sites
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 ?

Share this post


Link to post
Share on other sites
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,

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

😞

Share this post


Link to post
Share on other sites

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. πŸ™‚

Share this post


Link to post
Share on other sites

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