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
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
you would want to modify your packages->core_commerce->elements->checkout->payment->methods.php to look like so:
ChadStrat
<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) { ?>
Viewing 15 lines of 43 lines. View entire code block.
ChadStrat
Dude you saved my life with this post! Amazing work!
Though somewhat removed from the problem I am trying to solve, this code snippet is nonetheless very userful for making user/group decisions....
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.