Allow vote and comments only for a special group

  • Posts: 184
  • Thank you received: 4
12 years 3 months ago #60300

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?

Please Log in or Create an account to join the conversation.

  • Posts: 82819
  • Thank you received: 13366
  • MODERATOR
12 years 3 months ago #60370

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.

Please Log in or Create an account to join the conversation.

  • Posts: 184
  • Thank you received: 4
12 years 3 months ago #60488

Thank you Nicolas, you are the best!

Please Log in or Create an account to join the conversation.

Time to create page: 0.055 seconds
Powered by Kunena Forum