girl_dev Posted September 6, 2016 Share Posted September 6, 2016 I am using prestashop 1.6.1.2 with mutistore option. I have a shop for professional customers . I would like to set the company field and "VAT NUMBER" field ,which I added manually to B2B form ,to required, but it is required for all the shops . Link to comment Share on other sites More sharing options...
girl_dev Posted September 7, 2016 Author Share Posted September 7, 2016 any help please? Link to comment Share on other sites More sharing options...
rocky Posted September 8, 2016 Share Posted September 8, 2016 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. 1 Link to comment Share on other sites More sharing options...
girl_dev Posted September 8, 2016 Author Share Posted September 8, 2016 finally I find the solution :in controllers/AuthController.phpin the function public function postProcessI 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 1 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