Jump to content
Karush

display domain checker on custom page

Recommended Posts

Hello everyone, I created a new page, but I can’t display the form for finding a domain on it. This form is displayed only on the main page. What should I do?

 

{if $registerdomainenabled || $transferdomainenabled}
            <form method="post" class="domain-search-form" action="domainchecker.php" id="frmDomainHomepage">
                <input type="hidden" name="transfer" />
            <input type="text" name="domain" placeholder="{$LANG.exampledomain}" autocapitalize="none" data-toggle="tooltip" data-placement="left" data-trigger="manual" title="{lang key='orderForm.required'}">
{*            <input type="submit" value="Поиск">*}
                {if $registerdomainenabled}
                    <input type="submit" class="btn search{$captcha->getButtonClass($captchaForm)}" value="{$LANG.search}" />
                {/if}
                {include file="$template/includes/captcha.tpl"}
        </form>
        {/if}

Share this post


Link to post
Share on other sites
3 minutes ago, Karush said:

What should I do?

get rid of that IF statement and the closing {if} statement - those conditions will never be met on a custom page, so that's why the form won't show.

on a general point, you often (nearly always!) can't copy&paste code from one template into another and expect it to work.

the code in the thread below will work - it's just needs CSS applying to it to suit your site...

it's basically the code from the Integration Code in Utilities...

https://docs.whmcs.com/Linking_to_WHMCS#Integrating_a_Domain_Availability_Check_into_your_Website

or another way would be to use the domainchecker data feed.

Share this post


Link to post
Share on other sites
5 minutes ago, brian! said:

избавьтесь от этого оператора IF и оператора закрытия {if} - эти условия никогда не будут выполнены на пользовательской странице, поэтому форма не будет отображаться.

в общем, вы часто (почти всегда!) не можете копировать и вставлять код из одного шаблона в другой и ожидать, что он будет работать.

код в цепочке ниже будет работать - ему просто нужно применить CSS, чтобы он соответствовал вашему сайту ...

это в основном код из кода интеграции в утилитах ...

https://docs.whmcs.com/Linking_to_WHMCS#Integrating_a_Domain_Availability_Check_into_your_Website

или другой способ - использовать поток данных domainchecker .

But how can I deduce in this way how on the main there are some restrictions?

Share this post


Link to post
Share on other sites
Just now, Karush said:

But how can I deduce in this way how on the main there are some restrictions?

I'm just a novice and not really good at it

Share this post


Link to post
Share on other sites
44 minutes ago, Karush said:

But how can I deduce in this way how on the main there are some restrictions?

always assume that there are... unless you find otherwise. 🙂

for example, you can't copy the code from the invoices template and expect it to work on a custom page - it won't - because the invoices template is passed arrays of data to output and a custom page won't have those arrays.

47 minutes ago, Karush said:

I'm just a novice.

we all were once.

Share this post


Link to post
Share on other sites
9 minutes ago, brian! said:

всегда предполагайте, что есть ... если вы не найдете иначе. 🙂

например, вы не можете скопировать код из шаблона счетов и ожидать, что он будет работать на пользовательской странице - это не будет - потому что шаблону счетов передаются массивы данных для вывода, и пользовательская страница не будет иметь этих массивов ,

мы все были когда-то.

already made thank you very much but can I use these arrays or not

Share this post


Link to post
Share on other sites
10 minutes ago, brian! said:

always assume that there are... unless you find otherwise. 🙂

for example, you can't copy the code from the invoices template and expect it to work on a custom page - it won't - because the invoices template is passed arrays of data to output and a custom page won't have those arrays.

we all were once.

and one more question can I display the price list of domains on a custom page, if so, how

 

Share this post


Link to post
Share on other sites
11 minutes ago, brian! said:

always assume that there are... unless you find otherwise. 🙂

for example, you can't copy the code from the invoices template and expect it to work on a custom page - it won't - because the invoices template is passed arrays of data to output and a custom page won't have those arrays.

we all were once.

 

Screenshot_3.png

Share this post


Link to post
Share on other sites
12 minutes ago, Karush said:

already made thank you very much but can I use these arrays or not

on the original default page, yes - on a custom page, they probably won't exist.... some arrays/variables are available in all pages (including custom); arrays that are available to a specific existing page, will not be available to a custom page.

13 minutes ago, Karush said:

one more question can I display the price list of domains on a custom page, if so, how

I should mention first that there is already a separate domain pricing page available in WHMCS - you should just need to go to yourdomain.com/domain/pricing/ (the url might change depending on your friendly URLs settings)...

k8DEHDD.png

even if you could copy the Smarty code from the existing template (either above or domain register), to do the same on a custom page would require at least 2 arrays to be recreated using action hooks - you would probably need to play with the CSS too.

there's a domain pricing table data feed, but you would need to add css or rewrite the code to make it look like the default domain pricing table.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated