DARKF3D3 Posted February 3, 2014 Share Posted February 3, 2014 I trying to remove all unnecessary field in registration form, one of that it's the "country field" infact i sell only to one country, so there's no need of a select with only one field. This is the actual code: <tr> <td class="registr_sin">Nazione</td> <td class="registr_des"> <select id="id_country" name="id_country"><option value="">-</option><option selected="selected" value="10">Italy</option></select> </td> </tr> The importat is that the field is not showed but the variable is still stored when sending the form, because prestashop need contry id. If i hide the row in this way it should work? <tr style="display: none;"> Or maybe it's better something like this? <input type="hidden" id="id_country" name="id_country" value="10"> Link to comment Share on other sites More sharing options...
DARKF3D3 Posted February 5, 2014 Author Share Posted February 5, 2014 Any help? Link to comment Share on other sites More sharing options...
vekia Posted February 5, 2014 Share Posted February 5, 2014 <tr style="display: none;"> in my opinion this option is enough to hide this field from registration form Link to comment Share on other sites More sharing options...
DARKF3D3 Posted February 5, 2014 Author Share Posted February 5, 2014 (edited) I try in that way but it doesn't work.It give error: "no ID country", i think that when the field is in an hidden element it doesn't pass the value. I'll try with: <input type="hidden" Hope it works. EDIT Unfortunatelly it doesn't works. I also see this post where the user solved using a 1x1px image, but i think it's not the best solution: http://www.prestashop.com/forums/topic/121943-remove-country-dropdown-completely/ I think the problem with the input type="hidden" method is that you also remove all other code that are required for showing the right state: <td class="registr_des"> <select name="id_country" id="id_country"> <option value="">-</option> {foreach from=$countries item=v} <option value="{$v.id_country}" {if ($sl_country == $v.id_country)} selected="selected"{/if}>{$v.name|escape:'htmlall':'UTF-8'}</option> {/foreach} </select> <sup>*</sup> {assign var='stateExist' value=true} </td> Edited February 5, 2014 by DARKF3D3 (see edit history) Link to comment Share on other sites More sharing options...
DARKF3D3 Posted February 8, 2014 Author Share Posted February 8, 2014 (edited) I just found a partial solution to the proble, instead of using display:none or the "input type hidden" i set the style="visibility:hidden" on the <tr> that contain the field. In this way it workd, the problem is that the field is not displayed but there's a white space of the same dimension. I really don't understand why an input type="hidden" with same, name id and value of the select doesn't pass the variable when the form is submitted... Edited February 8, 2014 by DARKF3D3 (see edit history) Link to comment Share on other sites More sharing options...
DARKF3D3 Posted February 20, 2014 Author Share Posted February 20, 2014 After a lot of try I haven't yet find a working solution, It's frustrating, because It seem to be so simple to remove/hide a field, but every way i try it doesn't works. But for shops that sell to only one country it's useless show the country field. Link to comment Share on other sites More sharing options...
Recommended Posts