LP-Studio Posted February 10, 2019 Share Posted February 10, 2019 Hello everyoneI am preparing a new e-commerce with prestashop 1.7.4.2 and I would like to include a description in the company and VAT number fields.It's possible?I have attached an image of what I would like to do.thanks a lot Link to comment Share on other sites More sharing options...
Rolige Posted February 11, 2019 Share Posted February 11, 2019 Hi, The most easy (but not the best) is editing the file: /themes/classic/templates/_partials/form-fields.tpl In the code: {block name='form_field_item_other'} <input class="form-control" name="{$field.name}" type="{$field.type}" value="{$field.value}" {if isset($field.availableValues.placeholder)}placeholder="{$field.availableValues.placeholder}"{/if} {if $field.maxLength}maxlength="{$field.maxLength}"{/if} {if $field.required}required{/if} > {if isset($field.availableValues.comment)} <span class="form-control-comment"> {$field.availableValues.comment} </span> {/if} {/block} Add a little validation like this: {if $field.name == 'company'} <small>company extra info</small> {elseif $field.name == 'vat_number'} <small>vat number extra info</small> {/if} Final code: {block name='form_field_item_other'} <input class="form-control" name="{$field.name}" type="{$field.type}" value="{$field.value}" {if isset($field.availableValues.placeholder)}placeholder="{$field.availableValues.placeholder}"{/if} {if $field.maxLength}maxlength="{$field.maxLength}"{/if} {if $field.required}required{/if} > {if isset($field.availableValues.comment)} <span class="form-control-comment"> {$field.availableValues.comment} </span> {/if} {if $field.name == 'company'} <small>company extra info</small> {elseif $field.name == 'vat_number'} <small>vat number extra info</small> {/if} {/block} And will looks like this: Regards! Link to comment Share on other sites More sharing options...
LP-Studio Posted February 11, 2019 Author Share Posted February 11, 2019 It works great!Thank you so much Rolige Link to comment Share on other sites More sharing options...
MojoSwift Posted June 25, 2020 Share Posted June 25, 2020 On 2/11/2019 at 12:29 PM, Rolige said: Hi, The most easy (but not the best) is editing the file: /themes/classic/templates/_partials/form-fields.tpl In the code: {block name='form_field_item_other'} <input class="form-control" name="{$field.name}" type="{$field.type}" value="{$field.value}" {if isset($field.availableValues.placeholder)}placeholder="{$field.availableValues.placeholder}"{/if} {if $field.maxLength}maxlength="{$field.maxLength}"{/if} {if $field.required}required{/if} > {if isset($field.availableValues.comment)} <span class="form-control-comment"> {$field.availableValues.comment} </span> {/if} {/block} Add a little validation like this: {if $field.name == 'company'} <small>company extra info</small> {elseif $field.name == 'vat_number'} <small>vat number extra info</small> {/if} Final code: {block name='form_field_item_other'} <input class="form-control" name="{$field.name}" type="{$field.type}" value="{$field.value}" {if isset($field.availableValues.placeholder)}placeholder="{$field.availableValues.placeholder}"{/if} {if $field.maxLength}maxlength="{$field.maxLength}"{/if} {if $field.required}required{/if} > {if isset($field.availableValues.comment)} <span class="form-control-comment"> {$field.availableValues.comment} </span> {/if} {if $field.name == 'company'} <small>company extra info</small> {elseif $field.name == 'vat_number'} <small>vat number extra info</small> {/if} {/block} And will looks like this: Regards! This really helped me too. Thanks!! However, the code doesn't seem to work for the STATE field. {elseif $field.name == 'id_state'} <small>my text</small> Any idea what I can do to add a comment to this field too? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now