Header Domain Search
Use this setup when you want a small header form that starts a domain search, then lets the customer choose from available domains inside the Ultimate Multisite checkout.
Requirements
- Ultimate Multisite network-active.
- Multisite Ultimate Domain Seller network-active.
- At least one active domain registration product with:
domain_providerset to a configured provider.- Supported TLDs configured, for example
com,net, andorg.
- A valid checkout form containing the Domain Selection field.
Checkout form
- Create or edit the checkout form used by the registration page.
- Add the normal required checkout/account fields, including Username. A checkout form containing only the domain field is rejected by Ultimate Multisite validation.
- Add a Domain Selection field.
- Set the Domain Selection mode to Register Only when the flow should focus on registered domains rather than free subdomains or existing domains.
- Assign the domain registration product to that field.
The registration page should render the checkout form, for example:
[wu_checkout slug="domain-form"]
Header form
Add a small GET form in the site header that sends the entered search term to the checkout page as domain_name:
<form class="ums-header-domain-search" action="/register/" method="get">
<label class="screen-reader-text" for="ums-header-domain-search-input">Search for a domain</label>
<input id="ums-header-domain-search-input" name="domain_name" type="text" placeholder="Find your domain" autocomplete="off">
<button type="submit">Search</button>
</form>
Do not preselect a domain in custom header JavaScript. The header should only pass the search term. The Domain Seller checkout script reads ?domain_name=example, fills the checkout search box, and runs the availability search so the customer can choose from the returned domains.
Expected behaviour
Searching example in the header should open:
/register/?domain_name=example
The checkout should then display selectable results such as:
example.comexample.netexample.orgunavailable- other provider-supported TLDs
After selecting an available result, the order summary should include the domain registration product and the selected domain name.
Verification
- Open the home page.
- Search for a bare name, for example
example. - Confirm the checkout URL includes
?domain_name=example. - Confirm the checkout domain field contains
example. - Confirm a list of domain choices appears.
- Click Select for an available domain.
- Confirm the order summary contains
Domain Registration - example.comor the selected domain.
Troubleshooting
- If no list appears, check the browser network tab for
admin-ajax.php?action=wu_domain_searchand confirm it returns non-emptydomainsorresults. - If the checkout form fails validation while saving, add the required account fields such as Username.
- If selecting a domain does not update the cart, confirm
window.wu_checkout_formexists and that the Domain Seller checkout assets are loaded on the checkout page.