Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » [BUG] checking shopper group in...
[BUG] checking shopper group in virtuemart does not work
[BUG] checking shopper group in virtuemart does not work
Hello,
I bought chameleon and configuring it (it is awesome!) but I have one issue. It seems like rule does not check shopping group in virtuemart - it always success (even if shopper group rule is not true).
The code for checking vm_shopper_group rule is missing in virtuemartrules.php.
Could you check it and fix it asap or suggest workaround? Thank you.
Best Regards
Artur
Re: [BUG] checking shopper group in virtuemart does not work
I added at line 372
Code:
// Shopper Group
if (! plgChameleonVirtuemartrules::checkShopperGroup( $vm, $params, $debug )) {
return plgChameleonVirtuemartrules::bail($params);
}
and checkShopperGroup function definition and the end:
Code:
static function checkShopperGroup( $vm, $params, $debug ) {
if ( !$vm ) return false; // fail if no genius for vm. Shouldn't happen.
$shopper_group_id = $params->get( 'vm_shopper_group' );
if ( !is_array($shopper_group_id) or !count($shopper_group_id) ) return true; // nothing to check
require_once(JPATH_ADMINISTRATOR . '/components/com_virtuemart/helpers/config.php');
VmConfig::loadConfig();
$usermodel = VmModel::getModel('user');
$currentVMuser = $usermodel->getUser();
$real_id = (array)$currentVMuser->shopper_groups;
//$r = in_array( $real_id, $shopper_group_id ); // does not work
$r = false;
if ($real_id[0] == $shopper_group_id[0]) $r = true;
if ( $debug ) {
if ( $r ) cham_debug_prefix( JText::sprintf( 'VM shopper group id: shopper group id (%s) is in the include list - succeeding', $real_id[0] ) );
else cham_debug_prefix( JText::sprintf( 'VM shopper group id: shopper group id (%s) is not in the include list - failing', $real_id[0] ) );
}
return $r;
}
I compare only single shopper group (index 0 in array) - it is now working for me but please fix this bug in next release.
Re: [BUG] checking shopper group in virtuemart does not work
Hi Artur,
thanks so much for the bug report. This is now fixed (in a slightly different way to what you suggested, but that was useful thanks). It's now published as Chameleon 2.64 which you can download from your account.
Thanks,
Stephen
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » [BUG] checking shopper group in...
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5943
- Posts this week:
- 2
- User Info:
- Total Users:
- 7643
- Newest User:
- ulmer60661
- Members Online:
- 1
- Guests Online:
- 148
- Online:
- ulmer60661
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked