Certain groups of customers see a certain payment method?

Permalink
Hi,

Is it possible with advanced permissions that a certain group of users could see the default payment type? So normal users would see the standard type but if a certain user logs in they see the default one too?

If so how can this be done?

thanks for looking

 
JohntheFish replied on at Permalink Reply
JohntheFish
I have done a similar thing using css and jQuery. The options are all generated by C5, but then shown/hidden in the browser.

First, some css to hide all the options that are not generally visible.
Then, some jQuery that loads with the page and checks which options are wanted (in my case I was switching payment method on shipping method and details, not on user identity), and shows those that are wanted and removes those that are not.

This trick should not be used where security depends on it, but just where the overall user experience is desired.
RadiantWeb replied on at Permalink Best Answer Reply
RadiantWeb
you would want to modify your packages->core_commerce->elements->checkout->payment->methods.php to look like so:

<form method="post" action="<?php echo $action?>">
   <?php 
   $methods = $o->getAvailablePaymentMethods();
   Loader::model('user');
   Loader::model('userinfo');
   $u = new User();
   if($u->isLoggedIn()){
      $uGs = $u->getUserGroups();
      if(in_array('Administrators',$uGs) || in_array('Staff',$uGs)){
         $is_admin = true;
      }else{
         $is_admin = false;
      }
   }
   if (count($methods) > 0) { ?>


ChadStrat
creativesolutions replied on at Permalink Reply
creativesolutions
Dude you saved my life with this post! Amazing work!
jvermeer replied on at Permalink Reply
jvermeer
Though somewhat removed from the problem I am trying to solve, this code snippet is nonetheless very userful for making user/group decisions....