Jump to content

How to change default payment methods when adding new group ?


pierrepli

Recommended Posts

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

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

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...