Jump to content

Campo SIRET obbligatorio nel form di registrazione PS 1.7


Recommended Posts

Salve a tutti,
 

Vorrei poter stabilire come obbligatorio il campo SIRET durante la registrazione, uso PS 1.7.

 

Ho letto che é possibile con PS 1.6, ne avrei bisogno con PS 1.7, per cortesia aiutatemi.
 
Ho provato in questo modo:
 
 
1.  Line 189 - classes/Customer.php: 
                'siret' => array('type' => self::TYPE_STRING, 'validate' => 'isSiret', 'required' => true, 'size' => 60),
 
 
2.  line 523 - controllers/admin/AdminCustomersController.php:
            $this->fields_form['input'][] = array(
                'type' => 'text',
                'label' => $this->trans('SIRET', array(), 'Admin.OrdersCustomers.Feature'),
                'name' => 'siret',
                'required' => true
 
 
3. Nel momento in cui provo a registrarmi, e validando correttamente un SIRET, ricevo il seguente errore:
 
 

[PrestaShopException]
 
Property Customer->siret is empty
at line 915 in file classes/ObjectModel.php


910.             }
911. 
912.             $message = $this->validateField($field, $this->$field);
913.             if ($message !== true) {
914.                 if ($die) {
915.                     throw new PrestaShopException($message);
916.                 }
917.                 return $error_return ? $message : false;
918.             }
919.         }
920. 


    ObjectModelCore->validateFields - [line 248 - classes/ObjectModel.php]
    ObjectModelCore->getFields - [line 489 - classes/ObjectModel.php]
    ObjectModelCore->add - [line 261 - classes/Customer.php] - [2 Arguments]
    CustomerCore->add - [line 447 - classes/ObjectModel.php] - [2 Arguments]
    ObjectModelCore->save - [line 189 - classes/form/CustomerPersister.php]
    CustomerPersisterCore->create - [line 61 - classes/form/CustomerPersister.php] - [2 Arguments]
    CustomerPersisterCore->save - [line 133 - classes/form/CustomerForm.php] - [3 Arguments]
    CustomerFormCore->submit - [line 46 - controllers/front/AuthController.php]
    AuthControllerCore->initContent - [line 201 - classes/controller/Controller.php]
    ControllerCore->run - [line 366 - classes/Dispatcher.php]
    DispatcherCore->dispatch - [line 28 - index.php] 

 
Mille grazie

Saluti cordiali

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More