Jump to content

Add select option to address customer registration


Recommended Posts

Hi, I'm adding a select field in prestashop registration. I followed this guide. Changing some values to my need (text field per select option).

 

I have a syntax problem in this file: AdminAddressesController.php in override/controllers/admin/. Where should add this:

array(
    'type' => 'text',
    'label' => $this->l('My custom field'),
    'name' => 'my_custom_field',
    'required' => false,
    'col' => '4',
    'hint' => $this->l('Just a custom field!')
),  

But I have to convert it to a select option, I try this:

array(
    'type' => 'select',
    'label' => $this->l('Condicion Fiscal'),
    'name' => 'condicion_fiscal',
    'required' => true,                            
    'options' => array(
                'query' => $options = array(
                            array(
                              'id_option' => 'Monotributista', // The value of the 'value' attribute of the <option> tag.
                              'name' => 'Monotributista' // The value of the text content of the  <option> tag.
                            ),
                            array(
                              'id_option' => 'Responsable inscripto',
                              'name' => 'Responsable inscripto'
                            )
                ),
                'id' => 'id_option',
                'name' => 'name' 
               )
), 

That it works is shown in the backoffice in Clients > Addresses. But apparently there is some other problem because after saving shows me the blank page. On the whole website is the same, whatever you want to save in the BO, BUM blank page

 

 

I hope you can help me with this. Thank You!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...