Jump to content

required field multistore prestashop


girl_dev

Recommended Posts

Unfortunately, the required fields are not multishop, so you can't have fields required for one shop, but not another. You'd have to hack a solution by finding the code that checks required fields and add some if statements that check the current shop ID.

  • Like 1
Link to comment
Share on other sites

finally I find the solution :
in controllers/AuthController.php
in the function  public function postProcess
I added: $id_shop = $this->context->shop->id;
then in this bloc :if (Tools::isSubmit('submitAccount') || Tools::isSubmit('submitGuestAccount')) {
I added:
if($id_shop==3){
         if (Tools::getValue('company') == '') {
                    $this->errors[] = Tools::displayError('company is required.');
         }
            if (Tools::getValue('vatnumber') == '') {
                    $this->errors[] = Tools::displayError('vatnumber is required.');
           }
            }

I hope it helps someone else
 

  • Like 1
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...