pierrepli Posted June 10, 2022 Share Posted June 10, 2022 When I add a new group, all payment methods are selected by default for this group. I'd like to restrict this to only one specific payment method, but can't find out how to do so. Thx Link to comment Share on other sites More sharing options...
Tom Girou Posted June 10, 2022 Share Posted June 10, 2022 Hello, You could override Group class (classes/Group.php), and change addModulesRestrictions function. In that function, it will affect all allowed modules to the group. If you want to restrict to one payment method, you can check the id of the other payment method modules (ps_module table), and remove it from the $modules array variable. Then, just call the parent method with the new $modules variable. If you're not developer you'll probably need to hire one to do it for you. Link to comment Share on other sites More sharing options...
pierrepli Posted June 10, 2022 Author Share Posted June 10, 2022 It worked perfectly, thanks a lot !! As I'm not a developper, I'm not sure my code is clean, but it works fine. foreach ($modules as $module) { if ($module == '13' || $module == '59') { continue; } foreach ($shops as $shop) { $sql .= '("' . (int) $module . '", "' . (int) $shop . '", "' . (int) $id_group . '"),'; } } 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