Fewl Posted March 10, 2020 Share Posted March 10, 2020 Hi, I am using PS 1.7.6.3 I have this hook to add a checkbox to the registration form which works fine on the account creation form: public function hookAdditionalCustomerFormFields() { if($this->context->customer->getGroups()[0] == 4) $v = true; else $v = false; return [ (new FormField) ->setName('professionnal_group[]') ->setType('checkbox') ->setValue($v) ->setRequired(true) ->setLabel($this->l('Je suis un professionnel')), ]; } Unfortunately, the setValue field is never passed to the tpl (below), even when I just hardcode the value to 1 so it's never checked! Kind of an issue on the form when the user 'edit' his account {elseif $field.type === 'checkbox'} {block name='form_field_item_checkbox'} <span class="custom-checkbox"> <label>{$field.availableValues} <input name="{$field.name}" type="checkbox" value="1" {if $field.value}checked="checked"{/if} {if $field.required}required{/if}> <span><i class="material-icons rtl-no-flip checkbox-checked"></i></span> {$field.label nofilter} </label> </span> {/block} Thanks for your help. Link to comment Share on other sites More sharing options...
Inter Svetainė Posted May 3, 2021 Share Posted May 3, 2021 Did You solve it? Still need it? Link to comment Share on other sites More sharing options...
Seb de ohmyweb! Posted October 13, 2021 Share Posted October 13, 2021 Solved here : https://github.com/PrestaShop/PrestaShop/pull/22285/files 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