Skip to main content

Rate and Comment based on usergroup?

More
12 years 6 months ago - 12 years 6 months ago #149363 by veeco
Hello, is there anyway to make different access to rating and comment?

for example:
user that is "Administrator" can rate and comment/review
user that is "Registered" user can only rate but cannot comment/review [their vote still count]
Last edit: 12 years 6 months ago by veeco.

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

More
12 years 6 months ago #149372 by Mohamed Thelji
Hello,
Don't think that there is an option to do that, so the solution will probably be to :
- Go to "Hikashop->Display->Views"
- Edit the "form" file of the "vote" view of your front-end template
- Change that line :
Code:
<p class="hikashop_form_comment ui-corner-top"><?php echo JText::_('HIKASHOP_LET_A_COMMENT'); ?></p>
By :
Code:
<?php $my = JFactory::getUser(); jimport('joomla.access.access'); $config =& hikashop_config(); $userGroups = JAccess::getGroupsByUser($my->id, (bool)$config->get('inherit_parent_group_access'));//$my->authorisedLevels(); if(!empty($userGroups)){ foreach($userGroups as $userGroup){ if($userGroup == YourGroupID){ ?> <p class="hikashop_form_comment ui-corner-top"><?php echo JText::_('HIKASHOP_LET_A_COMMENT'); ?></p>
Note that you'll have to replace the YourGroupID by your Joomla user group ID that you'll be able to find through your Joomla User manager page
- And edit that lines :
Code:
<?php } ?>
By :
Code:
<?php } } } } ?>

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

More
12 years 6 months ago #149484 by veeco
Thank You.

The code will make validate whether it's administrator or normal user right?
and hide/show the comment textbox right?
but how if comments and vote connected? The empty comment validation will prevent normal user to vote

any suggestion?

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

More
12 years 6 months ago #149514 by Mohamed Thelji
That code will only hide the comment text area and submit button for users which are not from the user group that you have set through the YourGroupID variable.
Isn't it what you wanted ?
The following user(s) said Thank You: veeco

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

More
7 years 4 weeks ago #310609 by tuanan@lethuongco.com.vn
Hi,
I try to follow your instruction but I don't where is the code
<?php
}
?>
=> I find two and reply by your sugguested code but the page still load error

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

More
7 years 4 weeks ago #310613 by nicolas
Hi,

The instructions are still the same with the latest version of HikaShop.
The lines
Code:
<?php } ?>
are just before the end of the file:
monosnap.com/file/ZSRAPNGQhCxTXJakQQG4R0sJNRJajb
If you don't replace both pieces of code as explained, it's normal that you get an error.

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

Time to create page: 0.205 seconds
Powered by Kunena Forum