- Posts: 175
- Thank you received: 0
Rate and Comment based on usergroup?
12 years 6 months ago - 12 years 6 months ago #149363
by veeco
Rate and Comment based on usergroup? was created 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]
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.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 6 months ago #149372
by Mohamed Thelji
Replied by Mohamed Thelji on topic Rate and Comment based on usergroup?
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 :
By :
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 :
By :
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>
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>
- And edit that lines :
Code:
<?php
}
?>
Code:
<?php
}
}
}
}
?>
Please Log in or Create an account to join the conversation.
12 years 6 months ago #149484
by veeco
Replied by veeco on topic Rate and Comment based on usergroup?
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?
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.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 6 months ago #149514
by Mohamed Thelji
Replied by Mohamed Thelji on topic Rate and Comment based on usergroup?
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 ?
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.
Less
More
- Posts: 21
- Thank you received: 1
7 years 4 weeks ago #310609
by tuanan@lethuongco.com.vn
Replied by tuanan@lethuongco.com.vn on topic Rate and Comment based on usergroup?
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
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.
7 years 4 weeks ago #310613
by nicolas
Replied by nicolas on topic Rate and Comment based on usergroup?
Hi,
The instructions are still the same with the latest version of HikaShop.
The lines
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.
The instructions are still the same with the latest version of HikaShop.
The lines
Code:
<?php
}
?>
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.190 seconds