Jump to content

Issue assigning values to hostname, ns1 prefix and ns2 prefix input fields via URL parameters


Ioshf.a

Recommended Posts

Hello WHMCS community,

I need to assign values via the url parameters that come from my corporate website's order form to the input fields found in the configureproduct.tpl, in whmcs portal.

Currently, all values are carried over from my corporate site to my whmcs portal except for the input fields of hostname, ns1 prefix and ns2 prefix.

Now, I can see  through the dev tools that the fields of hostname, ns1 and ns2 have their values assigned in the url parameters as the rest of the values that are carried over that refer to configoption ids:

From my corporate site:

1540183523_inputsincorporatewebsite.png.f9e188d2f096ed3c7d3829f6f30472eb.png

 

the url parameters sent to WHMCS portal:

322149123_urlparametervalues.png.a171233e7ce3fc9ff4cbd01ca0e431ab.png

In addition, I customized the hostname input field to have a value auto-assigned based on $smarty.now|date_format:'%Y%m%d%H%M%S' whenever the input submitted (through the url parameter or not) to the said field is null.

My approach on this in regards to configureproduct.tpl can be seen in the following lines for the input field of hostname:

<input type="text" name="hostname" class="form-control" id="inputHostname" value="{if empty($smarty.get.hostname)}VL{$smarty.now|date_format:'%Y%m%d%H%M%S'}{else}{$smarty.get.hostname}{/if}">

Unfortunately, Smarty insists on acknowledging the URL parameters of those three input fields as null or empty. 

And thus, I get the following result in WHMCS portal:

897826199_assignedvalueswhenurlparametersarenullforhostnamens1ns2inconfigureproduct_tpl.png.4dcf491169acefc4fc459ac98d088dc6.png

Ι have also tried implementing these through $smarty.get.variablename, $smarty.request.variablename as well as by assigning the values  via the following script:

{assign var="hostname" value="{$smarty.get.hostname}"}
{assign var="ns1prefix" value="{$smarty.get.ns1prefix}"}
{assign var="ns2prefix" value="{$smarty.get.ns2prefix}"}

Any aid you can provide on this will be much appreciated.

Kind regards,

Ioshf.a

Link to comment
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.

×
×
  • 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