ae9803 Posted November 2, 2016 Share Posted November 2, 2016 Hi guys, Has anyone had issues with None showing twice? Check this out. Not sure if its a bug or what. What do you guys think? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 2, 2016 Share Posted November 2, 2016 first thought was a bug... on closer inspection, it seems to be a design feature! 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. 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. 0 Quote Link to comment Share on other sites More sharing options...
ae9803 Posted November 2, 2016 Author Share Posted November 2, 2016 first thought was a bug... on closer inspection, it seems to be a design feature! 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. 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? 0 Quote Link to comment Share on other sites More sharing options...
ae9803 Posted November 3, 2016 Author Share Posted November 3, 2016 I was able to resolve this issue in my code. I was calling an If statement using statement None however switching this to '' worked 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 3, 2016 Share Posted November 3, 2016 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>':''} 0 Quote Link to comment Share on other sites More sharing options...
ae9803 Posted November 15, 2016 Author Share Posted November 15, 2016 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. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 16, 2016 Share Posted November 16, 2016 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. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.