Jump to content

Issue with Dropdown in the custom fields


ae9803

Recommended Posts

first thought was a bug... on closer inspection, it seems to be a design feature! :roll:

 

it's adding "None" as an initial default option in all of the dropdowns by itself - and looks to be taking the value from the language files.

 

$_LANG['none'] = "None";

I think the quick fix is to remove "None" from your custom field select options and just have Wordpress.

 

SKndNyX.png

 

then you'll get None & Wordpress... perhaps make a test order with None selected and see what the results are.

 

the option after that would be to use a Language Override to change "None" to perhaps something more descriptive.

Link to comment
Share on other sites

first thought was a bug... on closer inspection, it seems to be a design feature! :roll:

 

it's adding "None" as an initial default option in all of the dropdowns by itself - and looks to be taking the value from the language files.

 

$_LANG['none'] = "None";

I think the quick fix is to remove "None" from your custom field select options and just have Wordpress.

 

SKndNyX.png

 

then you'll get None & Wordpress... perhaps make a test order with None selected and see what the results are.

 

the option after that would be to use a Language Override to change "None" to perhaps something more descriptive.

 

Hey,

Thanks for the response. I am trying to plugin a jquery that when a user selects none, nothing drops down, but if the user selects "wordpress" or another app. Something drops down. But the issue is, if is a design feature, Could I just remove the "None" from the language file?

Link to comment
Share on other sites

  • 2 weeks later...
for anyone else who wants to get rid of the empty "None" option, you could tweak the configureproduct.tpl template code and change

 

{$customfield.input}

to...

 

{$customfield.input|replace:'<option value="">{$LANG.none}</option>':''}

 

Hey Brian,

I am still running into an issue calling specific labels,

<div class="form-group">
                                       <label for="customfield{$customfield.id}">{$customfield.name}</label>
                                       {$customfield.input}



											{literal}
											<script language='javascript'>

												var autoInstallFieldName = $('customfield');

 

It pulls this:

 

                                       <div class="form-group">
                                       <label for="customfield319">Auto Application Installer</label>
                                       <select name="customfield[319]" id="customfield319" class="form-control"><option value="">None</option><option value="None">None</option><option value="AbanteCart">AbanteCart</option><option value="Drupal">Drupal</option><option value="Joomla">Joomla</option><option value="Magento">Magento</option><option value="Wordpress">Wordpress</option></select>




<script language='javascript'>

<var autoInstallFieldName = '#customfield9;

As you can see I need var in javascript to pull the label for on top. Thats where I am stuck so thats why I have it hard coded right now on var to work with customfield9, it will work for one package but not any others because I need to pull that field as well.

Link to comment
Share on other sites

Hi,

 

do you need to use the literal tags? the following should work..

 

                                {foreach $customfields as $customfield}
                                   <div class="form-group">
                                       <label for="customfield{$customfield.id}">{$customfield.name}</label>
                                       {$customfield.input}
                                           <script language='javascript'>
                                               var autoInstallFieldName = $('customfield{$customfield.id}') ;  
                                           </script>    

now if you mean you need the JavaScript before the label, then just move your JavaScript block of code to where you want it to run. :idea:

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