Allow vote and comments only for a special group
14 years 1 month ago #60300
by Teto
Allow vote and comments only for a special group was created by Teto
If i am not wrong you may decide to allow vote to everyone, registered or bought.
Is it possible to use a custom group?
I sell subscriptions, with this subs the customers receive at home 2 bottles of wine every months.
We sell also the same bottles of wine.
I would like to allow all the users with a valid subscription to vote the product.
With the current options I cannot do.
Do you have any ideas or suggestions?
Is it possible to use a custom group?
I sell subscriptions, with this subs the customers receive at home 2 bottles of wine every months.
We sell also the same bottles of wine.
I would like to allow all the users with a valid subscription to vote the product.
With the current options I cannot do.
Do you have any ideas or suggestions?
Please Log in or Create an account to join the conversation.
14 years 1 month ago #60370
by nicolas
Replied by nicolas on topic Re: Allow vote and comments only for a special group
There is no option for that.
You would have to edit the file "form" of the view "vote" via the menu Display->Views and change the line:
if(($access_vote == 'registered' && empty($hikashop_vote_user_id)) || ($access_vote == 'buyed' && $purchased == 0)){
to something like that:
$my = hikashop_loadUser(true);
$config =& hikashop_config();
$userGroups = JAccess::getGroupsByUser($my->id, (bool)$config->get('inherit_parent_group_access'));
$allowedGroups= array('XXX','YYY');
$inter = array_intersect($userGroups,$allowedGroups);
if(!empty($inter)){
where XXX and YYY are the ids of the user groups allowed access to the voting.
You would have to edit the file "form" of the view "vote" via the menu Display->Views and change the line:
if(($access_vote == 'registered' && empty($hikashop_vote_user_id)) || ($access_vote == 'buyed' && $purchased == 0)){
to something like that:
$my = hikashop_loadUser(true);
$config =& hikashop_config();
$userGroups = JAccess::getGroupsByUser($my->id, (bool)$config->get('inherit_parent_group_access'));
$allowedGroups= array('XXX','YYY');
$inter = array_intersect($userGroups,$allowedGroups);
if(!empty($inter)){
where XXX and YYY are the ids of the user groups allowed access to the voting.
Please Log in or Create an account to join the conversation.
14 years 1 month ago #60488
by Teto
Replied by Teto on topic Re: Allow vote and comments only for a special group
Thank you Nicolas, you are the best!
Please Log in or Create an account to join the conversation.
Time to create page: 0.183 seconds