Jump to content

how to display radio selection than checkbox in configureproduct.tpl


stevenrca

Recommended Posts

Hi Friends,

 

Wanted to know if their is any way to display radio selection than checkbox in product addons tpl file [configureproduct.tpl].

 

Below is whats the exisitng code.

 

{/if} {if $addons} {$LANG.cartaddons}

{$LANG.orderaddondescription}

{foreach key=num item=addon from=$addons} {$addon.checkbox}

{$addon.name} - {$addon.description}

{/foreach}

{/if} {if $customfields} {$LANG.orderadditionalrequiredinfo}

{$LANG.cartcustomfieldsdesc}

Link to comment
Share on other sites

Hi Steve Bros,

My intention is to allow only 1 addon in the selection. Thats why asked if any one can help me out. Following is the latest code - giving some error once selected - anyone can help me out here please.

 

<table>

{foreach key=num item=addon from=$addons}

<tr>

<td><input type="radio" name="addon.id" value="addons" id="addon.id" onclick="document.getElementById('addon').style.display='none'" /></td>

<td><label for="a{$addon.id}"><strong>{$addon.name}</strong> - {$addon.description} </label></td>

</tr>

{/foreach}

</table>

Link to comment
Share on other sites

hi,

 

Was able to get few things done ... but still not able to pass the values to next page. The below display radio selection or the list.

 

<table>

{foreach key=num item=addon from=$addons}

<tr>

<td><input type="radio" name="radioaddon" value="addon" id="addon.id"/></td>

<td><label for="a{$addon.id}"><strong>{$addon.name}</strong> - {$addon.description} </label></td>

</tr>

{/foreach}

</table>

 

 

 

<select name="addon">

{foreach key=num item=addon from=$addons}

<option value="a{$addon.id}"><strong>{$addon.name}</strong> - {$addon.description}</option>

{/foreach}

</select>

 

 

Apriciate if some one can help me out on this. :?

Link to comment
Share on other sites

  • 2 weeks later...

Howdy,

 

I got this working fine with no issues.

 

{foreach key=num item=configoption from=$configurableoptions}

<tr class="orderrow{if $num % 2}2{else}1{/if}">

<td>{$configoption.optionname}</td>

<td>

{foreach key=num2 item=options from=$configoption.options}

	<input type="radio" name="configoption[{$configoption.id}]" value="{$options.id}"{if $configoption.selectedvalue eq $options.id} checked{/if}>{$options.name} <br />

{/foreach}

</td>

</tr>

{/foreach}

Online Example:

https://hq.solidnetdc.com/orders/order.php?step=2&pid=165&systemtemplate=portal

 

FYI: I am running an older version of WHMCS and do not know if the same syntax is still used for newer versions.

 

 

Thanks,

Adam

Link to comment
Share on other sites

Can someone pls explain how to parse the value from the addons to the next page from a SELECT dropdown menu.

 

<select name="addon">

{foreach key=num item=addon from=$addons}

<option value="a{$addon.id}"><strong>{$addon.name}</strong> - {$addon.description}</option>

{/foreach}

</select>

Link to comment
Share on other sites

Can someone pls explain how to parse the value from the addons to the next page from a SELECT dropdown menu.

 

<select name="addon">

{foreach key=num item=addon from=$addons}

<option value="a{$addon.id}"><strong>{$addon.name}</strong> - {$addon.description}</option>

{/foreach}

</select>

 

Howdy,

 

Can you explain to us what you are trying to do? Create a dropdown box, or what? I do not understand what your question.

 

 

Thanks,

Adam

Link to comment
Share on other sites

Can someone pls explain how to parse the value from the addons to the next page from a SELECT dropdown menu.

 

<select name="addon">

{foreach key=num item=addon from=$addons}

<option value="a{$addon.id}"><strong>{$addon.name}</strong> - {$addon.description}</option>

{/foreach}

</select>

Try this... not 100% sure but it should work

<select name="addon" onchange="submit()">

{foreach key=num item=addon from=$addons}

<option value="a{$addon.id}"><strong>{$addon.name}</strong> - {$addon.description}</option>

{/foreach}

</select>

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.

  • 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